Hello,
Thank you for this great project.
While using it in our codebase, I have found the following issue.
anonymize_dataset fails if dataset contains RawDataElement
anonymize_dataset fails if the dataset contains RawDataElement:
Proposed solution
I would be happy to create a PR to fix this issue here too.
I see two possibilities:
- Sanitize dataset as part of anonymize_dataset:
- iterate over the dataset and replace RawDataElements,
- continue with the current code of anonymize_dataset.
- Modify current replace_element code to handle the RawDataElement case.
I'm partial to solution 1.:
- it's simple and easy to understand and review.
- it makes it easier for the user to add custom-rules since they are able to assume that all elements are RawDataElement, and they can use the simpler: element.value = new_value syntax.
- however, it also means that input dataset are walked-through twice. I feel that this price is worth paying.
Best
Guillaume
Hello,
Thank you for this great project.
While using it in our codebase, I have found the following issue.
anonymize_dataset fails if dataset contains RawDataElement
anonymize_dataset fails if the dataset contains RawDataElement:
element.value = new_valuefails. In my case, it's in replace_element_UID (https://github.com/KitwareMedical/dicom-anonymizer/blob/master/dicomanonymizer/simpledicomanonymizer.py#L96) but I believe that all other rules have the same issue.Proposed solution
I would be happy to create a PR to fix this issue here too.
I see two possibilities:
I'm partial to solution 1.:
- it's simple and easy to understand and review.
- it makes it easier for the user to add custom-rules since they are able to assume that all elements are RawDataElement, and they can use the simpler: element.value = new_value syntax.
- however, it also means that input dataset are walked-through twice. I feel that this price is worth paying.
Best
Guillaume