本文整理匯總了Python中pylinac.vmat.VMAT.load_image方法的典型用法代碼示例。如果您正苦於以下問題:Python VMAT.load_image方法的具體用法?Python VMAT.load_image怎麽用?Python VMAT.load_image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pylinac.vmat.VMAT
的用法示例。
在下文中一共展示了VMAT.load_image方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Test_DRGS_105
# 需要導入模塊: from pylinac.vmat import VMAT [as 別名]
# 或者: from pylinac.vmat.VMAT import load_image [as 別名]
class Test_DRGS_105(VMATMixin, unittest.TestCase):
"""Tests of the result values of DRMLC images at 105cm SID."""
drgs_105_open = osp.join(_vmat_test_files_dir, 'DRGSopen-105-example.dcm')
drgs_105_dmlc = osp.join(_vmat_test_files_dir, 'DRGSmlc-105-example.dcm')
def setUp(self):
self.vmat = VMAT()
self.vmat.load_image(self.drgs_105_open, 'open')
self.vmat.load_image(self.drgs_105_dmlc, 'dmlc')
self.vmat.settings.x_offset = 20
def test_overall_passed(self):
"""Test that the overall pass flag is true for default settings"""
super().test_overall_passed('drgs')
def test_segment_positions(self):
"""Test various values of the Segments."""
self.vmat.analyze('drgs')
segment_dict = {0: Point(371, 384), 2: Point(478, 384)}
super().test_segment_positions(segment_dict)
def test_segment_values(self):
self.vmat.analyze('drgs')
segment_dict = {
0: {'r_dev': 0.780, 'r_corr': 102.43},
4: {'r_dev': -0.282, 'r_corr': 101.357},
}
super().test_segment_values(segment_dict)
示例2: Test_MLCS_105
# 需要導入模塊: from pylinac.vmat import VMAT [as 別名]
# 或者: from pylinac.vmat.VMAT import load_image [as 別名]
class Test_MLCS_105(VMATMixin, unittest.TestCase):
"""Tests of the result values of MLCS images at 105cm SID."""
drmlc_105_open = osp.join(_vmat_test_files_dir, 'DRMLCopen-105-example.dcm')
drmlc_105_dmlc = osp.join(_vmat_test_files_dir, 'DRMLCmlc-105-example.dcm')
def setUp(self):
self.vmat = VMAT()
self.vmat.load_image(self.drmlc_105_open, 'open')
self.vmat.load_image(self.drmlc_105_dmlc, 'dmlc')
def test_overall_passed(self):
"""Test that the overall pass flag is true for default settings"""
super().test_overall_passed('mlcs')
def test_segment_positions(self):
"""Test various values of the Segments."""
self.vmat.analyze('mlcs')
segment_dict = {0: Point(391, 384), 2: Point(552, 384)}
super().test_segment_positions(segment_dict)
def test_segment_values(self):
self.vmat.analyze('mlcs')
segment_dict = {
0: {'r_dev': -0.040, 'r_corr': 100.83},
2: {'r_dev': -0.021, 'r_corr': 100.85},
}
super().test_segment_values(segment_dict)
示例3: TestLoading
# 需要導入模塊: from pylinac.vmat import VMAT [as 別名]
# 或者: from pylinac.vmat.VMAT import load_image [as 別名]
class TestLoading(TestCase):
"""Tests of the various loading schemas."""
def setUp(self):
self.vmat = VMAT()
def test_load_image(self):
good_name = osp.join(vmat_test_files_dir, 'no_test_type_dmlc.dcm')
bad_name = osp.join(vmat_test_files_dir, 'no_test_or_image_type_1.dcm')
# image type can be determined from a good name
self.vmat.load_image(good_name)
# but not a bad one
with self.assertRaises(ValueError):
self.vmat.load_image(bad_name)
def test_from_urls(self):
urls = ['https://s3.amazonaws.com/assuranceqa-staging/uploads/imgs/DRGS_dmlc.dcm',
'https://s3.amazonaws.com/assuranceqa-staging/uploads/imgs/DRGS_open.dcm']
VMAT.from_urls(urls) # shouldn't raise
def test_passing_3_images(self):
"""Test passing the wrong number of images."""
with self.assertRaises(ValueError):
self.vmat.load_images(('', '', ''))
def test_demo_image_loads(self):
"""Test the that demo images load properly."""
# shouldn't raise
self.vmat.load_demo_image(DRGS)
self.vmat.load_demo_image(DRMLC)
def test_from_zip(self):
path = osp.join(vmat_test_files_dir, 'DRMLC.zip')
v = VMAT.from_zip(path)
v.analyze()
def test_loading_with_bad_names(self):
one = osp.join(vmat_test_files_dir, 'no_test_or_image_type_1.dcm')
two = osp.join(vmat_test_files_dir, 'no_test_or_image_type_2.dcm')
with self.assertRaises(ValueError):
self.vmat.load_images((one, two))
# but will work when everything is specified
self.vmat.load_image(one, OPEN)
self.vmat.load_image(two, DMLC)
self.vmat.analyze(DRMLC)