pydicom / deid

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

Add REMOVE with custom function to screen tags #113

Closed vsoch closed 4 years ago

vsoch commented 4 years ago

This PR is start of work to address #112, specifically we need a way to provide a custom function to look over all tags, and remove based on some condition. As is described in the documentation, this will require providing a function to the item that will return True or False.

This PR does not yet include adding private tags to list of fields, as this needs more testing.

Signed-off-by: vsoch vsochat@stanford.edu

vsoch commented 4 years ago

I can definitely change to bot.warning. As for the error on return types, this occurred to me when I was writing the functions for REMOVE that require a boolean return. I do think we should address this, but not scoped to this PR. I'll open an issue for it.

vsoch commented 4 years ago

okay take a look - I changed 3/4 of the bot.exit to bot.warning. I kept bot.exit in the case that REMOVE is used incorrectly (something other than a func is provided, which REMOVE doesn't currently support).

vsoch commented 4 years ago

Thank you for your review! https://pypi.org/project/deid/0.1.38