How to use pylinac - 10 common examples

To help you get started, we’ve selected a few pylinac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jrkerns / pylinac / tests_basic / test_vmat.py View on Github external
filepaths = ('DRGSopen-105-example.dcm', 'DRGSdmlc-105-example.dcm')
    klass = DRGS
    segment_positions = {0: Point(371, 384), 2: Point(478, 384)}
    segment_values = {
        0: {'r_dev': 1.385, 'r_corr': 15.12},
        4: {'r_dev': -0.8, 'r_corr': 14.8},
    }
    avg_abs_r_deviation = 0.68
    max_r_deviation = 1.38


class TestDRMLC2(VMATMixin, TestCase):
    """Tests of the result values of MLCS images at 105cm SID."""
    filepaths = ('DRMLC#2_open.dcm', 'DRMLC#2_dmlc.dcm')
    klass = DRMLC
    segment_positions = {0: Point(199, 192), 2: Point(275, 192)}
    segment_values = {
        0: {'r_dev': 0.77, 'r_corr': 6.1},
        2: {'r_dev': -1.1, 'r_corr': 6},
    }
    avg_abs_r_deviation = 1.4
    max_r_deviation = 1.98
    passes = False


class TestDRGS2(VMATMixin, TestCase):
    """Tests of the result values of DRMLC images at 105cm SID."""
    filepaths = ('DRGS#2_open.dcm', 'DRGS#2_dmlc.dcm')
    klass = DRGS
    segment_positions = {0: Point(191, 192), 2: Point(242, 192)}
    segment_values = {
        0: {'r_dev': 1.5, 'r_corr': 6.4},
github jrkerns / pylinac / tests_basic / test_vmat.py View on Github external
filepaths = ('DRMLCopen-105-example.dcm', 'DRMLCdmlc-105-example.dcm')
    segment_positions = {0: Point(391, 384), 2: Point(552, 384)}
    segment_values = {
        0: {'r_dev': -2.1, 'r_corr': 13.6},
        2: {'r_dev': 0.22, 'r_corr': 14},
    }
    avg_abs_r_deviation = 1.06
    max_r_deviation = 2.11
    passes = False


class TestDRGS105(VMATMixin, TestCase):
    """Tests of the result values of DRMLC images at 105cm SID."""
    filepaths = ('DRGSopen-105-example.dcm', 'DRGSdmlc-105-example.dcm')
    klass = DRGS
    segment_positions = {0: Point(371, 384), 2: Point(478, 384)}
    segment_values = {
        0: {'r_dev': 1.385, 'r_corr': 15.12},
        4: {'r_dev': -0.8, 'r_corr': 14.8},
    }
    avg_abs_r_deviation = 0.68
    max_r_deviation = 1.38


class TestDRMLC2(VMATMixin, TestCase):
    """Tests of the result values of MLCS images at 105cm SID."""
    filepaths = ('DRMLC#2_open.dcm', 'DRMLC#2_dmlc.dcm')
    klass = DRMLC
    segment_positions = {0: Point(199, 192), 2: Point(275, 192)}
    segment_values = {
        0: {'r_dev': 0.77, 'r_corr': 6.1},
        2: {'r_dev': -1.1, 'r_corr': 6},
github jrkerns / pylinac / tests_basic / test_cbct.py View on Github external
def test_phan_center(self):
        """Test locations of the phantom center."""
        known_phan_center = Point(257, 255)
        self.cbct.analyze()
        self.assertAlmostEqual(self.cbct.ctp404.phan_center.x, known_phan_center.x, delta=0.7)
        self.assertAlmostEqual(self.cbct.ctp404.phan_center.y, known_phan_center.y, delta=0.7)
github jrkerns / pylinac / tests_basic / core / test_image.py View on Github external
def setUp(self):
        self.img = image.load(tif_path)
        self.dcm = image.load(dcm_path)
        array = np.arange(42).reshape(6, 7)
        self.arr = image.load(array)
github jrkerns / pylinac / tests_basic / core / test_image.py View on Github external
def setUp(self):
        self.img = image.load(tif_path)
        self.dcm = image.load(dcm_path)
        array = np.arange(42).reshape(6, 7)
        self.arr = image.load(array)
github jrkerns / pylinac / tests_basic / core / test_image.py View on Github external
def setUpClass(cls):
        cls.dcm = image.load(dcm_path)
github jrkerns / pylinac / tests_basic / core / test_image.py View on Github external
def test_load_array(self):
        arr = np.arange(36).reshape(6, 6)
        img = image.load(arr)
        self.assertIsInstance(img, ArrayImage)
github jrkerns / pylinac / tests_basic / core / test_image.py View on Github external
def test_nonsense(self):
        with self.assertRaises(FileNotFoundError):
            image.load('blahblah')
github jrkerns / pylinac / tests_basic / utils.py View on Github external
def file_should_be_processed(self, filepath):
        """Decision of whether file should be run. Returns boolean."""
        try:
            image.load(filepath)
            return True
        except:
            return False
github jrkerns / pylinac / tests_basic / test_flatsym.py View on Github external
def get_filename(cls):
        return retrieve_demo_file(url='flatsym_demo.dcm')