Skip to content

nicom MultiframeWrapper fails to return image_shape attribute with multi-volume mri data #1388

Open
@AlanKuurstra

Description

@AlanKuurstra

Does the nibabel.nicom dicom wrapper support multi-frame dicoms with multiple volumes?

I have a dicom with frame index ordering: "Temporal Position Index", "Stack ID", "In Stack Position Number". Loading the dicom and attempting to access the image_shape attribute

mw = dw.wrapper_from_file(filepath, force=True, stop_before_pixels=True)
mw.image_shape

fails with error:

Traceback (most recent call last):
  File "/home/akuurstr/.config/JetBrains/PyCharm2024.2/scratches/heudiconv_bruker_dicom_conversion.py", line 65, in <module>
    mw.image_shape
  File "/usr/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/virtualization/python_virtualenvs/heudiconv/lib/python3.10/site-packages/nibabel/nicom/dicomwrappers.py", line 770, in image_shape
    raise WrapperError('Non-singular index precedes the slice index')
nibabel.nicom.dicomwrappers.WrapperError: Non-singular index precedes the slice index

It seems MultiframeWrapper wants the stack position number to be the slowest changing index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions