pydicom / deid

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

Detect exits when recipe does not contain filters #155

Closed mjcbello closed 3 years ago

mjcbello commented 3 years ago

Hi @vsoch ,

I've been working with @wetzelj on our internal deid pipeline project. It has been really interesting working with all things DICOM and pydicom/deid. Thank you for your contributions!

During my testing, I noticed that calling detect on the DicomCleaner results in a bot.exit() if the current recipe file does not contain any filter sections. Is this the intended behavior of the application? Any objections to returning flagged=False instead of sys.exit?

detect.py lines 124-127:

    # Load criteria (actions) for flagging
    filters = deid.get_filters()
    if not filters:
        bot.exit("Deid provided does not have %filter, exiting.")
vsoch commented 3 years ago

Definitely not! It would be good to, in addition to adding the return, print a clear message for the user (debug or info, up to you!)

mjcbello commented 3 years ago

Sounds good! I have a fix ready. Would you like me to submit a pull request against the currently opened pull request #154 or a new pull request against master?

vsoch commented 3 years ago

It would be easier to package it in the same version as #154 - and if you have bandwidth and are able, a review of the PR would be helpful! Sometimes users open issues and then there is a fix but they never come back to review, even if things are ready to go. So your review would be greatly appreciated!

vsoch commented 3 years ago

And wow, I'm honored you opened your first issue here! Open source is a lot of fun, welcome to GitHub!

image