diff --git a/dicomsort.py b/dicomsort.py index d8a196a..108579e 100755 --- a/dicomsort.py +++ b/dicomsort.py @@ -179,6 +179,9 @@ def renameFile(self,file): ds = dicom.read_file(file,stop_before_pixels=True) except InvalidDicomError: return False + except KeyError: + # needed for issue with pydicom 0.9.9 and some dicomdir files + return False # check for valid path - abort program to avoid overwrite path = self.pathFromDatasetPattern(ds) if os.path.exists(path):