File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,24 @@ def test_header_scaling():
189
189
assert_false (np .all (fp_scaling == dv_scaling ))
190
190
191
191
192
+ def test_header_dimension_labels ():
193
+ hdr = PARRECHeader (HDR_INFO , HDR_DEFS )
194
+ # check volume labels
195
+ vol_labels = hdr .get_dimension_labels ()
196
+ assert_equal (list (vol_labels .keys ()), ['dynamic scan number' ])
197
+ assert_array_equal (vol_labels ['dynamic scan number' ], [1 , 2 , 3 ])
198
+ # check that output is ndarray rather than list
199
+ assert_true (isinstance (vol_labels ['dynamic scan number' ], np .ndarray ))
200
+ # check case with individual slice labels
201
+ slice_vol_labels = hdr .get_dimension_labels (collapse_slices = False )
202
+ # verify that both expected keys are present
203
+ assert_true ('slice number' in slice_vol_labels )
204
+ assert_true ('dynamic scan number' in slice_vol_labels )
205
+ # verify shape of labels matches final dimensions of data
206
+ assert_equal (slice_vol_labels ['slice number' ].shape ,
207
+ hdr .get_data_shape ()[2 :])
208
+
209
+
192
210
def test_orientation ():
193
211
hdr = PARRECHeader (HDR_INFO , HDR_DEFS )
194
212
assert_array_equal (HDR_DEFS ['slice orientation' ], 1 )
You can’t perform that action at this time.
0 commit comments