We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 706de72 commit 093b51aCopy full SHA for 093b51a
nibabel/nicom/dicomwrappers.py
@@ -509,11 +509,14 @@ def image_shape(self):
509
if hasattr(first_frame, 'get') and first_frame.get([0x18, 0x9117]):
510
# DWI image may include derived isotropic, ADC or trace volume
511
try:
512
- self.frames = pydicom.Sequence(
+ anisotropic = pydicom.Sequence(
513
frame
514
for frame in self.frames
515
if frame.MRDiffusionSequence[0].DiffusionDirectionality != 'ISOTROPIC'
516
)
517
+ # Image contains DWI volumes followed by derived images; remove derived images
518
+ if len(anisotropic) != 0:
519
+ self.frames = anisotropic
520
except IndexError:
521
# Sequence tag is found but missing items!
522
raise WrapperError('Diffusion file missing information')
0 commit comments