@@ -578,6 +578,37 @@ def test_data_fake(self):
578
578
sorted_data = data [..., [3 , 1 , 2 , 0 ]]
579
579
fake_mf ['pixel_array' ] = np .rollaxis (sorted_data , 2 )
580
580
assert_array_equal (MFW (fake_mf ).get_data (), data * 2.0 - 1 )
581
+ # 5D!
582
+ dim_idxs = [
583
+ [1 , 4 , 2 , 1 ],
584
+ [1 , 2 , 2 , 1 ],
585
+ [1 , 3 , 2 , 1 ],
586
+ [1 , 1 , 2 , 1 ],
587
+ [1 , 4 , 2 , 2 ],
588
+ [1 , 2 , 2 , 2 ],
589
+ [1 , 3 , 2 , 2 ],
590
+ [1 , 1 , 2 , 2 ],
591
+ [1 , 4 , 1 , 1 ],
592
+ [1 , 2 , 1 , 1 ],
593
+ [1 , 3 , 1 , 1 ],
594
+ [1 , 1 , 1 , 1 ],
595
+ [1 , 4 , 1 , 2 ],
596
+ [1 , 2 , 1 , 2 ],
597
+ [1 , 3 , 1 , 2 ],
598
+ [1 , 1 , 1 , 2 ]]
599
+ frames = fake_frames ('FrameContentSequence' ,
600
+ 'DimensionIndexValues' ,
601
+ dim_idxs )
602
+ fake_mf ['PerFrameFunctionalGroupsSequence' ] = frames
603
+ fake_mf ['NumberOfFrames' ] = len (frames )
604
+ shape = (2 , 3 , 4 , 2 , 2 )
605
+ data = np .arange (np .prod (shape )).reshape (shape )
606
+ sorted_data = data .reshape (shape [:2 ] + (- 1 ,), order = 'F' )
607
+ order = [11 , 9 , 10 , 8 , 3 , 1 , 2 , 0 ,
608
+ 15 , 13 , 14 , 12 , 7 , 5 , 6 , 4 ]
609
+ sorted_data = sorted_data [..., np .argsort (order )]
610
+ fake_mf ['pixel_array' ] = np .rollaxis (sorted_data , 2 )
611
+ assert_array_equal (MFW (fake_mf ).get_data (), data * 2.0 - 1 )
581
612
582
613
def test__scale_data (self ):
583
614
# Test data scaling
0 commit comments