@@ -295,36 +295,27 @@ def test_freesurfer_large_vector_hack(self):
295
295
def test_freesurfer_ico7_hack (self ):
296
296
HC = self .header_class
297
297
hdr = HC ()
298
-
299
298
# Test that using ico7 shape automatically uses factored dimensions
300
299
hdr .set_data_shape ((163842 , 1 , 1 ))
301
300
assert_array_equal (hdr ._structarr ['dim' ][1 :4 ], np .array ([27307 , 1 , 6 ]))
302
-
303
301
# Test consistency of data in .mgh and mri_convert produced .nii
304
- nib_data = get_nibabel_data ()
305
- nitest_path = os .path .join (nib_data , 'nitest-freesurfer' )
306
-
302
+ nitest_path = os .path .join (get_nibabel_data (), 'nitest-freesurfer' )
307
303
mgh = mghload (os .path .join (nitest_path , 'fsaverage' , 'surf' ,
308
304
'lh.orig.avg.area.mgh' ))
309
305
nii = load (os .path .join (nitest_path , 'derivative' , 'fsaverage' , 'surf' ,
310
306
'lh.orig.avg.area.nii' ))
311
-
312
307
assert_equal (mgh .shape , nii .shape )
313
308
assert_array_equal (mgh .get_data (), nii .get_data ())
314
309
assert_array_equal (nii .header ._structarr ['dim' ][1 :4 ],
315
310
np .array ([27307 , 1 , 6 ]))
316
-
317
311
# Test writing produces consistent nii files
318
312
with InTemporaryDirectory ():
319
313
nii .to_filename ('test.nii' )
320
-
321
314
nii2 = load ('test.nii' )
322
-
323
315
assert_equal (nii .shape , nii2 .shape )
324
316
assert_array_equal (nii .get_data (), nii2 .get_data ())
325
317
assert_array_equal (nii .get_affine (), nii2 .get_affine ())
326
318
327
-
328
319
def test_qform_sform (self ):
329
320
HC = self .header_class
330
321
hdr = HC ()
0 commit comments