pydicom / deid

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

Bug fix for header adds after deletes #141

Closed wetzelj closed 4 years ago

wetzelj commented 4 years ago

Description

Related issues: # 140

Corrected issue occurring when a ADD action occurs after a REMOVE action. Previously, the REMOVE would delete the tag from the header, but the field would remain in the fields list. This created an issue with subsequent ADD actions due to the fact that the item would be found in the fields dictionary and would be treated as a replace. After correcting this issue by removing the item from the fields list, it introduced an issue when iterating over the fields dictionary while processing multiple-field actions. To accommodate this the iteration over the fields dictionary was switched to a clone so that the dictionary on which we are iterating would not be changed by potential REMOVE actions.

Checklist

Open questions

Questions that require more discussion or to be addressed in future development:

vsoch commented 4 years ago

As usual, you've done a great job @wetzelj ! If you are done working, I'm good to merge and release!

wetzelj commented 4 years ago

@vsoch - I'm good with it if you are!

vsoch commented 4 years ago

Thank you! https://pypi.org/project/deid/0.2.15/