Closed jstorrs closed 1 year ago
Oh, it's not pytest... do you run them:
python -m unittest deid/tests/test_*.py
I always check the testing file to remember the command!
In what cases would someone have an identifier and not the name?
The various DICOM tag are organized into functional groups.
In CTP for example one of the rules that are available is to keep an entire group. See for example the "k" element in CTP scripts:
https://github.com/johnperry/CTP/blob/master/source/files/examples/example-ctp-dicom-anonymizer.script https://github.com/johnperry/CTP/blob/master/source/files/examples/example-tfs-dicom-anonymizer.script
<k en="T" t="0018">Keep group 0018</k>
<k en="T" t="0020">Keep group 0020</k>
<k en="T" t="0028">Keep group 0028</k>
In CTP, I can't remember if the documentation discusses the script files directly because in CTP you're intended to use the configuration utility and not the XML directly. But the k elements work on entire groups specified by the t attribute. en is whether that particular rule is enabled. Groups 18, 20 and 28 are often useful for this sort of targeting (the inner contents of the script elements are just descriptive text entered by the user).
https://mircwiki.rsna.org/index.php?title=The_CTP_DICOM_Anonymizer
Oh neat!
So the formatting tests (that are failing) are fairly simple - you run black (new version) on deid.
black deid
and that should fix the test failure. And then just add a note to the CHANGELOG.md and bump the version in deid/version.py and we will be good to go!
This looks great! :partying_face:
I think we are just about ready for merge. The last little bit (which I forgot in my last comments, sorry about that) is to add a few sentences and a quick example to the user facing docs - I think maybe on this page? https://pydicom.github.io/deid/user-docs/recipe-headers/
Thanks @jstorrs ! This is a cool little addition (very useful!) and I'll get it released soon.
Description
This is an attempt to add a group: field expander to support some CTP-style rules that target tag groups. The idea is to support rules such as:
KEEP group:0018
Checklist
Open questions
I've tested this interactively, but unfortunately, I haven't yet figured out how to get pytest to run on deid. It keeps complaining that deid.tests is an unknown module (see attached). I'm new to pytest so I'm probably messing something obvious up.pytest-errors.txt