Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flexibility for redacting custom DICOM tags #239

Merged
merged 9 commits into from
Sep 3, 2024

Conversation

naglepuff
Copy link
Collaborator

@naglepuff naglepuff commented Aug 1, 2024

Fix #188

Breaking change

Any custom rule sets with delete_custom_metadata specified will need to be updated to use the new custom_metadata_action option.

Changes

Replaces the delete_custom_metadata option in the rule set with custom_metadata_action. This can either be omitted, in which case a rule is needed for each piece of custom metadata in order for the image to be redacted, or set to "keep" or "delete". If an action is specified, it will be applied if there is no rule for the custom metadata element. This is still only used for DICOM rule sets. The base rule set is configured to delete all custom metadata.

TODO

  • Documentation
  • Tests

Replaces the `delete_custom_metadata` option in the rule set with
`custom_metadata_action`. This can either be omitted, in which case a
rule is needed for each piece of custom metadata in order for the image
to be redacted, or set to `"keep"` or `"delete"`. If an action is
specified, it will be applied if there is no rule for the custom
metadata element.
@naglepuff naglepuff marked this pull request as draft August 1, 2024 15:35
Exposed a bug where rules were not properly created if the keyword couldn't be determined.
Recent merge from main was broken. Additionally, recent update to maison broke yamlfix.
A workaround has been introduced here with a comment pointing to the issue in the yamlfix
repo.
@naglepuff naglepuff marked this pull request as ready for review August 26, 2024 19:08
@naglepuff naglepuff requested a review from manthey August 26, 2024 19:09

* `keep`: Retain the custom metadata value after redaction.
* `delete`: Delete the custom metadata tag from the image.
* `use_rule`: This mode will fall back to rules specified for each piece of custom metadata in the `metadata` section of the rule set. If a custom metadata tag with no corresponding rule is encountered, the image will not be redacted, as the redaction plan would be considered incomplete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tag-level rules always apply even with keep or delete, right? If so, we should mention that, too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct. Let me know if the language added in a86c1d2 is clear enough.

tox.ini Outdated Show resolved Hide resolved
@naglepuff naglepuff requested a review from manthey August 27, 2024 15:43
@naglepuff naglepuff merged commit ee0276f into main Sep 3, 2024
4 checks passed
@naglepuff naglepuff deleted the 188-dicom-custom-metadata-redaction branch September 3, 2024 14:03
@naglepuff naglepuff restored the 188-dicom-custom-metadata-redaction branch September 3, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create third state for custom DICOM tag redaction
2 participants