Skip to content

Commit dc0acb7

Browse files
committed
ignore dicom files with SOPClassUIDs that are clearly not images
1 parent 774ac6c commit dc0acb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pymirc/fileio/read_dicom.py

+5
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ def get_data(self, frames = None):
233233
if self.dicomlist is None:
234234
self.dicomlist = [dicom.read_file(x) for x in self.filelist]
235235

236+
# check if some images have a SOPclassUID that does not belong to images and drop them
237+
# SOPClassUID '1.2.840.10008.5.1.4.1.1.66' means Raw Data Storage
238+
# '1.2.840.10008.5.1.4.1.1.66.x' for x in (1,2,3,4) are also not images
239+
self.dicomlist = [x for x in self.dicomlist if not x.SOPClassUID.startswith('1.2.840.10008.5.1.4.1.1.66')]
240+
236241
self.read_all_dcms = True
237242

238243
self.TemporalPositionIdentifiers = []

0 commit comments

Comments
 (0)