pydicom / deid

best effort anonymization for medical images using python
https://pydicom.github.io/deid/
MIT License
140 stars 43 forks source link

Pixel cleaner failures #149

Closed wetzelj closed 3 years ago

wetzelj commented 3 years ago

There are a couple small issues in clean.py:

  1. Many old recipes contain filter sections which only contain coordinates and do not contain keepcoordinates properties. The absence of keepcoordinates causes a KeyError exception when attempting to retrieve the keepcoordinates from the DICOMCleaner results (clean.py - line 153)

  2. For 2-dimensional images, the cleaner falls into the else condition (clean.py - line 201) which causes no pixel masking to be performed and an exception to be thrown because self.original.shape is not converted to a string prior to being used in the format statement.

I've committed proposed fixes in this commit. Let me know if you have any suggestions on this. It's the first I've looked at pixel cleaning functionality.

vsoch commented 3 years ago

Thank you @wetzelj ! I added some comments on the code in case it doesn't send a notification.

wetzelj commented 3 years ago

Fixed with #150.