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):
511
511
has_derived = False
512
512
if hasattr (first_frame , 'get' ) and first_frame .get ([0x18 , 0x9117 ]):
513
513
# DWI image may include derived isotropic, ADC or trace volume
514
- # check and remove
515
514
try :
516
515
self .frames = Sequence (
517
516
frame for frame in self .frames if
518
517
frame .MRDiffusionSequence [0 ].DiffusionDirectionality
519
518
!= 'ISOTROPIC'
520
519
)
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
523
524
except IndexError :
524
525
# Sequence tag is found but missing items!
525
526
raise WrapperError ("Diffusion file missing information" )
526
527
except AttributeError :
527
528
# DiffusionDirectionality tag is not required
528
529
pass
530
+
529
531
assert len (self .frames ) == n_frames
530
532
frame_indices = np .array (
531
533
[frame .FrameContentSequence [0 ].DimensionIndexValues
You can’t perform that action at this time.
0 commit comments