Skip to content

Commit

Permalink
Fix conversion of frame-dependent elements
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Apr 3, 2024
1 parent a43ab7f commit 53d0092
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/python/dicomifier/dicom_to_nifti/meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,14 @@ def get_meta_data(stack, cache=None):
# Already converted
elements[tag] = element
if frame is not None:
# Fetch frame-specific elements
# Fetch frame-specific elements. Each frame will be part of only one
# stack, so caching is meaningless here
groups = data_set[odil.registry.PerFrameFunctionalGroupsSequence][frame]
if tag not in elements or isinstance(elements[tag], dict):
_fill_meta_data_dictionary(
groups,
lambda tag, value:
elements.setdefault(tag, {}).update({i: value}),
skipped, no_recurse)
# Otherwise element has already been converted
_fill_meta_data_dictionary(
groups,
lambda tag, value:
elements.setdefault(tag, {}).update({i: value}),
skipped, no_recurse)

# Convert dictionary with possible holes to list: iteration is quicker.
elements = {
Expand Down

0 comments on commit 53d0092

Please sign in to comment.