deid
deid copied to clipboard
feat: copy the RSNA anonymizer protocol
Description
I've added to the deid/data/deid.dicom protocol a large number of header removal and small number of blanks. These header removals/blanks were extracted from the 2022-03-08 version of the RSNA anonymizer software http://mirc.rsna.org/download/Anonymizer-installer.jar
The jar file was unzipped, the unzipped jar has a file
dicom-anonymizer.script with xml deidentification directives.
all @remove
and @empty
commands were extracted from the file
using grep
, and transformed into the corresponding REMOVE and
BLANK lines using sed
, copied in to a slightly modified
version of deid.dicom I've been modifying for work. The file was
post-processed using R to remove duplicated REMOVE directives.
The Anonymizer code is distributed under the RSNA public license http://mirc.rsna.org/rsnapubliclicense.pdf which is I believe to be compatible with the MIT license used in deid. So this derivative work should satisfy the terms of that license to be included in deid.
I've also updated the ADD directives to generate new UIDs as per the example in the docs, and to copy back in the SOPClassUID field. These can be removed as they may be too specialized to my use case.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [x] My code follows the style guidelines of this project
Open questions
Should the UID generating directives be removed?
I've updated the PR to include just the deidentification directives from the RSNA anonymizer script, I added additional things that weren't in the first version of the PR and updated the commit message to reflect this. The most important changed:
I've also pulled tag processing functions @all
@integer
@round
and @hashdate
. These were added as additional REMOVEs, and then ADDed back, dates and UIDs get a func: processing lookup, key identifiers like PatientID get var: exact lookups. Please have a look when you get a chance.
Thanks @vsoch, I will make the changes suggested above, as soon as I get a chance.
Sounds good! I'm giving the other folks mentioned in the issue a little bit to respond, and if they don't it probably means they don't have bandwidth and I'll make some time in a coming evening / weekend to implement these deid-provided functions.
@cfhammill please see https://github.com/pydicom/deid/pull/208 - when this is merged you will be able to provide a func: with a deid defined function and it will work without a hitch.
@cfhammill are you still interested in contributing this recipe? We've since added deid-provided replace uid functions (deid_func:<name>
), so it would be feasible to do here: https://pydicom.github.io/deid/user-docs/recipe-funcs/
yes I am still interested in contributing, thanks @vsoch. I'll try to find time in the next couple weeks to make the relevant changes.
Sounds good! Thank you!
Status?