Skip to content

Commit

Permalink
Fix for pydicom 0.9.9 and some non-dicom files (actually dicomdir)
Browse files Browse the repository at this point in the history
Fixes issue reported by Sonia Pujol.
  • Loading branch information
pieper committed Apr 24, 2015
1 parent 2af24b3 commit 006d570
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dicomsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 006d570

Please sign in to comment.