def test_from_stream(self): path = osp.join(TEST_DIR, 'Leeds_ccw.dcm') with open(path, 'rb') as f: s = io.BytesIO(f.read()) phan = LeedsTOR(s) phan.analyze() self.assertIsInstance(phan, LeedsTOR)
def OpenDialog(self, textparam): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName( self, "QFileDialog.getOpenFileName()", "", "All Files (*);;DICOM Files (*.dcm)", options=options) if fileName: leeds = LeedsTOR(fileName) leeds.analyze(low_contrast_threshold=0.01, hi_contrast_threshold=0.5) leeds.plot_analyzed_image(low_contrast=True) leeds.publish_pdf(fileName.title() + '.pdf', metadata={ "name": textparam, "unit": "TrueBeam STX" })
def test_from_file_object(self): path = osp.join(TEST_DIR, 'Leeds_ccw.dcm') with open(path, 'rb') as f: phan = LeedsTOR(f) phan.analyze() self.assertIsInstance(phan, LeedsTOR)