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

Tags within sequences (nested fields) are not affected by header actions #243

Closed
wetzelj opened this issue Dec 2, 2022 · 2 comments
Closed

Comments

@wetzelj
Copy link
Contributor

wetzelj commented Dec 2, 2022

While working on pull request #242 it was uncovered that when the BLANK operation was being used to act on a field nested within a sequence (example: Action: BLANK 00080050 Nested Tag: (0040, 0275)__0__(0008, 0050)), the index between the parent and child tag causes the get_nested_field function to return the tag incorrectly and therefore the tag within the sequence is not blanked. This error is also currently impacting the REMOVE action.

The get_nested_field function is only utilized in the BLANK and REMOVE actions, but I suspect that there are also issues with the other alter-type actions (JITTER and REPLACE) when acting on nested fields. When working this issue, the full functionality of header actions on nested fields should be reviewed and additional test cases written to validate that actions on nested fields have the intended effect.

The initial discussion where this came up can be seen in this comment of #242.

@vsoch
Copy link
Member

vsoch commented Dec 2, 2022

I thought this might be related to what we were returning (e.g., parent vs the value indexed).

wetzelj added a commit to wetzelj/deid that referenced this issue Dec 7, 2022
Corrected issue pydicom#243 which prevented tags within sequences from being acted upon.   Added unit tests for sequence processing.
vsoch pushed a commit that referenced this issue Dec 7, 2022
* Expand BLANK Action to other VRs

1. Expanded BLANK Action to other VRs.
2. Added unit tests for validating action interaction.
3. Added table of action interactions to help docs.

* Update recipe-headers.md
* Update test_action_interaction.py
Correcting bad test method names.
* Update deid-data install version
* Update parser.py

Reverted expand_field_expression to always return desired as a Tag.  Instead convert to DataElement in blank_field.

* Expanding blank to all VRs
Updating BLANK test coverage to all VRs.
* Updating field counts in unit tests.
Updating unit tests failing due to field count changes in test image.
* Update test_blank_action.py
Restructured blank_action unit tests.
* Fix for #244 - Replace fails for numeric VR
Removing deid-data pin.
* Update actions.py
Committing review suggestions.
* Header Sequence Updates
Corrected issue #243 which prevented tags within sequences from being acted upon.   Added unit tests for sequence processing

* Update test_replace_identifiers.py
Updated test_replace_identifiers to target ctbrain1.dcm by name.
* Update test_dicom_funcs.py

Updated test_user_provided_func to target ctbrain1.dcm
@vsoch
Copy link
Member

vsoch commented Dec 7, 2022

Closed with #242

@vsoch vsoch closed this as completed Dec 7, 2022
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

No branches or pull requests

2 participants