Skip to content

Exclude trace volume from Philips DICOM? #693

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

Closed
mgxd opened this issue Nov 13, 2018 · 0 comments · Fixed by #727
Closed

Exclude trace volume from Philips DICOM? #693

mgxd opened this issue Nov 13, 2018 · 0 comments · Fixed by #727
Milestone

Comments

@mgxd
Copy link
Member

mgxd commented Nov 13, 2018

Originally brought up in nipy/heudiconv#275 by @bmelo

Version: nibabel-2.3.1

Loading up a Philips diffusion DICOM (with trace volume) results in an incorrect image shape with an extra? dimension (96, 96, 60, 2, 33).

In [1]: from nibabel.nicom.dicomwrappers import wrapper_from_file

In [2]: mw = wrapper_from_file('philips-dwi.dcm', force=True)

In [3]: mw.image_shape
---------------------------------------------------------------------------
WrapperError                              Traceback (most recent call last)
<ipython-input-3-4963e90423f3> in <module>()
----> 1 mw.image_shape

/home/mathias/miniconda2/envs/dev3/lib/python3.6/site-packages/nibabel/onetime.py in __get__(self, obj, type)
    139         # Errors in the following line are errors in setting a
    140         # OneTimeProperty
--> 141         val = self.getter(obj)
    142 
    143         setattr(obj, self.name, val)

/home/mathias/miniconda2/envs/dev3/lib/python3.6/site-packages/nibabel/nicom/dicomwrappers.py in image_shape(self)
    535         n_vols = np.prod(shape[3:])
    536         if n_frames != n_vols * shape[2]:
--> 537             raise WrapperError("Calculated shape does not match number of "
    538                                "frames.")
    539         return tuple(shape)

WrapperError: Calculated shape does not match number of frames.
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 a pull request may close this issue.

2 participants