Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmanderson committed Sep 27, 2024
1 parent 49cbe5d commit c775dec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name='DicomRTTool',
author='Brian Mark Anderson',
author_email='b5anderson@health.ucsd.edu',
version='2.1.7',
version='2.1.8',
description='Services for reading dicom files, RT structures, and dose files, as well as tools for '
'converting numpy prediction masks back to an RT structure',
long_description=long_description,
Expand Down
7 changes: 4 additions & 3 deletions src/DicomRTTool/ReaderWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ def add_dicom_to_dictionary_from_path(self, dicom_path, images_dictionary: Dict[
rt_dictionary: Dict[str, RTBase],
rd_dictionary: Dict[str, RDBase],
rp_dictionary: Dict[str, PlanBase]):
file_list = [os.path.join(dicom_path, i) for i in os.listdir(dicom_path) if i.lower().endswith('.dcm')]
file_list = [i for i in os.listdir(dicom_path) if i.lower().endswith('.dcm')]
series_ids = self.reader.GetGDCMSeriesIDs(dicom_path)
all_names = []
for series_id in series_ids:
dicom_names = self.reader.GetGDCMSeriesFileNames(dicom_path, series_id)
all_names += dicom_names
all_names += [os.path.split(i)[1] for i in dicom_names]
self.image_reader.SetFileName(dicom_names[0])
self.image_reader.ReadImageInformation()
modality = self.image_reader.GetMetaData("0008|0060")
Expand All @@ -256,7 +256,8 @@ def add_dicom_to_dictionary_from_path(self, dicom_path, images_dictionary: Dict[
sitk_dicom_reader=self.image_reader, path=dicom_path,
sitk_string_keys=self.image_sitk_string_keys)
rt_files = [file for file in file_list if file not in all_names]
for lstRSFile in rt_files:
for i in rt_files:
lstRSFile = os.path.join(dicom_path, i)
rt = pydicom.read_file(lstRSFile)
modality = rt.Modality
if modality.lower().find('struct') != -1:
Expand Down

0 comments on commit c775dec

Please sign in to comment.