Exemple #1
0
 def pdf_filename(self):
     """The name of the file for the PDF results."""
     if self.zip_format:
         return self.base_name + '.pdf'
     else:
         dirname = osp.dirname(self.full_path[0])
         dcm = DicomImage(self.full_path[0])
         name = 'Winston-Lutz - {}.pdf'.format(dcm.date_created())
         return osp.join(dirname, name)
Exemple #2
0
 def pdf_filename(self):
     """The name of the file for the PDF results."""
     if self.zip_format:
         return self.base_name + '.pdf'
     else:
         dirname = osp.dirname(self.path[0])
         dcm = DicomImage(self.path[0])
         name = 'VMAT {} - {}.pdf'.format(self.test_type.upper(), dcm.date_created())
         return osp.join(dirname, name)
Exemple #3
0
 def run(cls, files, config, skip_list):
     files = drop_skips(files, skip_list)
     # analyze ZIP archives
     for file in files:
         cond1 = contains_keywords(file, config, cls.config_name)
         cond2 = file.endswith('.zip')
         if cond1 and cond2:
             obj = cls(file, config)
             obj.process()
             skip_list.append(osp.basename(file))
     # analyze directory groups
     if config[cls.config_name]['use-classifier']:
         imgs = [DicomImage(f) for f in files if is_dicom_image(f)]
         uids = [i.metadata.SeriesInstanceUID for i in imgs]
         c = collections.Counter(uids)
         for uid, num in c.items():
             if num == 2:
                 img_uids = [
                     i.path for i in imgs
                     if i.metadata.SeriesInstanceUID == uid
                 ]
                 obj = cls(img_uids, config, zip_format=False)
                 obj.process()
                 for img in img_uids:
                     skip_list.append(osp.basename(img))