@@ -30,6 +30,7 @@ def test_errormap():
3030 errmap = ErrorMap ()
3131 errmap .inputs .in_tst = os .path .join (tempdir , 'von.nii.gz' )
3232 errmap .inputs .in_ref = os .path .join (tempdir , 'alan.nii.gz' )
33+ errmap .out_map = os .path .join (tempdir , 'out_map.nii.gz' )
3334 result = errmap .run ()
3435 yield assert_equal , result .outputs .distance , 1.125
3536
@@ -57,19 +58,19 @@ def test_errormap():
5758 msimg1 = nib .Nifti1Image (msvolume1 , np .eye (4 ))
5859
5960 msvolume2 = np .zeros (shape = (2 ,2 ,2 ,2 ))
60- msvolume2 [:,:,:,0 ] = volume2
61- msvolume2 [:,:,:,1 ] = volume3
61+ msvolume2 [:,:,:,0 ] = volume3
62+ msvolume2 [:,:,:,1 ] = volume1
6263 msimg2 = nib .Nifti1Image (msvolume2 , np .eye (4 ))
6364
64- nib .save (img1 , os .path .join (tempdir , 'von-ray.nii.gz' ))
65- nib .save (img2 , os .path .join (tempdir , 'alan-ray.nii.gz' ))
65+ nib .save (msimg1 , os .path .join (tempdir , 'von-ray.nii.gz' ))
66+ nib .save (msimg2 , os .path .join (tempdir , 'alan-ray.nii.gz' ))
6667
6768 errmap .inputs .in_tst = os .path .join (tempdir , 'von-ray.nii.gz' )
6869 errmap .inputs .in_ref = os .path .join (tempdir , 'alan-ray.nii.gz' )
6970 errmap .inputs .metric = 'sqeuclidean'
7071 result = errmap .run ()
71- yield assert_equal , result .outputs .distance , 7.0
72+ yield assert_equal , result .outputs .distance , 5.5
7273
7374 errmap .inputs .metric = 'euclidean'
7475 result = errmap .run ()
75- yield assert_equal , result .outputs .distance , 2 ** 0.5 + 6
76+ yield assert_equal , result .outputs .distance , np . float32 ( 1.25 * ( 2 ** 0.5 ))
0 commit comments