File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -511,21 +511,23 @@ def image_shape(self):
511511 has_derived = False
512512 if hasattr (first_frame , 'get' ) and first_frame .get ([0x18 , 0x9117 ]):
513513 # DWI image may include derived isotropic, ADC or trace volume
514- # check and remove
515514 try :
516515 self .frames = Sequence (
517516 frame for frame in self .frames if
518517 frame .MRDiffusionSequence [0 ].DiffusionDirectionality
519518 != 'ISOTROPIC'
520519 )
521- n_frames = len (self .frames )
522- has_derived = True
520+ if n_frames != len (self .frames ):
521+ warnings .warn ("Derived images found and removed" )
522+ n_frames = len (self .frames )
523+ has_derived = True
523524 except IndexError :
524525 # Sequence tag is found but missing items!
525526 raise WrapperError ("Diffusion file missing information" )
526527 except AttributeError :
527528 # DiffusionDirectionality tag is not required
528529 pass
530+
529531 assert len (self .frames ) == n_frames
530532 frame_indices = np .array (
531533 [frame .FrameContentSequence [0 ].DimensionIndexValues
You can’t perform that action at this time.
0 commit comments