示例#1
0
 def test_load_from_file_object(self):
     path = osp.join(TEST_DIR, 'CBCT_4.zip')
     ref_cbct = CatPhan504.from_zip(path)
     with open(path, 'rb') as f:
         cbct = CatPhan504.from_zip(f)
         cbct.analyze()
     self.assertIsInstance(cbct, CatPhan504)
     self.assertEqual(cbct.origin_slice, ref_cbct.origin_slice)
示例#2
0
 def test_load_from_stream(self):
     path = osp.join(TEST_DIR, 'CBCT_4.zip')
     ref_cbct = CatPhan504.from_zip(path)
     with open(path, 'rb') as f:
         s = io.BytesIO(f.read())
         cbct = CatPhan504.from_zip(s)
         cbct.analyze()
     self.assertIsInstance(cbct, CatPhan504)
     self.assertEqual(cbct.origin_slice, ref_cbct.origin_slice)
示例#3
0
def run_catphan504(path):
    """Function to pass to the process pool executor to process cbct images."""
    try:
        mypf = CatPhan504.from_zip(path)
        mypf.analyze()
        return 'Success'
    except (ValueError, FileNotFoundError, BadZipfile) as e:
        return 'Failure: {} @ {}'.format(e, path)
示例#4
0
    def OpenDirectory(self, textparam):
        directory = QFileDialog.getExistingDirectory(
            self, 'Select backup directory')
        win_directory = QtCore.QDir.toNativeSeparators(directory)
        d.pathDir = win_directory

        mycbct = CatPhan504(win_directory)
        mycbct.analyze()
        mycbct.plot_analyzed_subimage('linearity')
        mycbct.save_analyzed_subimage('linearity.png', subimage='linearity')
        mycbct.publish_pdf(d.pathDir + '\\result.pdf',
                           metadata={
                               "name": textparam,
                               "unit": "TrueBeam STX"
                           })
示例#5
0
 def setUpClass(cls):
     cls.cbct = CatPhan504.from_demo_images()
     cls.cbct.analyze()
示例#6
0
 def setUp(self):
     self.cbct = CatPhan504.from_demo_images()
示例#7
0
 def setUpClass(cls):
     cls.cbct = CatPhan504.from_demo_images()
     cls.cbct.analyze()
示例#8
0
 def setUp(self):
     self.cbct = CatPhan504.from_demo_images()
示例#9
0
 def test_504(self):
     CatPhan504.run_demo()