Skip to content

Fallback to shared groups on missing per frame tag#632

Merged
Enet4 merged 7 commits intoEnet4:masterfrom
TidalPaladin:get-from-empty-guard
Feb 14, 2025
Merged

Fallback to shared groups on missing per frame tag#632
Enet4 merged 7 commits intoEnet4:masterfrom
TidalPaladin:get-from-empty-guard

Conversation

@TidalPaladin
Copy link
Copy Markdown
Contributor

Some DICOMs provide tags under SharedFunctionalGroupsSequence that are not present under PerFrameFunctionalGroupsSequence. In such cases, getter functions like window_width() will return an empty vector rather than falling back to a check on SharedFunctionalGroupsSequence. Thus a guard is needed so that when PerFrameFunctionalGroupsSequence exists but does not contain the target tag, a fallback check on SharedFunctionalGroupsSequence will happen.

This PR implements such a guard by modifying get_from_per_frame() and get_from_shared() such that empty iterator returns are instead mapped to None. The existing logic of the getter functions will then fall back to a shared check.

@TidalPaladin TidalPaladin changed the title Get from empty guard Fallback to shared groups on missing per frame tag Feb 2, 2025
@TidalPaladin TidalPaladin marked this pull request as ready for review February 2, 2025 15:16
@Enet4 Enet4 self-requested a review February 3, 2025 16:04
@Enet4 Enet4 added A-lib Area: library C-pixeldata Crate: dicom-pixeldata labels Feb 3, 2025
Copy link
Copy Markdown
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

Thank you for working on this! Just leaving a minor suggestion inline and should be ready to merge.

Co-authored-by: Eduardo Pinho <enet4mikeenet@gmail.com>
@TidalPaladin
Copy link
Copy Markdown
Contributor Author

Updated as suggested, thanks for the prompt review

Copy link
Copy Markdown
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

All good. Thank you very much!

@Enet4 Enet4 merged commit b2002bb into Enet4:master Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library C-pixeldata Crate: dicom-pixeldata

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants