@@ -72,7 +72,7 @@ def test_read_mgh():
72
72
assert_equal (h ['dof' ], 0 )
73
73
assert_equal (h ['goodRASFlag' ], 1 )
74
74
assert_array_equal (h ['dims' ], [3 , 4 , 5 , 2 ])
75
- assert_almost_equal (h ['tr' ], 2 )
75
+ assert_almost_equal (h ['tr' ], 2.0 )
76
76
assert_almost_equal (h ['flip_angle' ], 0.0 )
77
77
assert_almost_equal (h ['te' ], 0.0 )
78
78
assert_almost_equal (h ['ti' ], 0.0 )
@@ -150,9 +150,14 @@ def test_write_noaffine_mgh():
150
150
def test_set_zooms ():
151
151
mgz = load (MGZ_FNAME )
152
152
h = mgz .header
153
- assert_array_almost_equal (h .get_zooms (), [1 , 1 , 1 , 0.002 ])
154
- h .set_zooms ([1 , 1 , 1 , 3 ])
155
- assert_array_almost_equal (h .get_zooms (), [1 , 1 , 1 , 3 ])
153
+ assert_array_almost_equal (h .get_zooms (units = 'raw' ), [1 , 1 , 1 , 2 ])
154
+ assert_array_almost_equal (h .get_zooms (units = 'norm' ), [1 , 1 , 1 , 0.002 ])
155
+ h .set_zooms ([1 , 1 , 1 , 3 ], units = 'raw' )
156
+ assert_array_almost_equal (h .get_zooms (units = 'raw' ), [1 , 1 , 1 , 3 ])
157
+ assert_array_almost_equal (h .get_zooms (units = 'norm' ), [1 , 1 , 1 , 0.003 ])
158
+ h .set_zooms ([1 , 1 , 1 , 3 ], units = 'norm' )
159
+ assert_array_almost_equal (h .get_zooms (units = 'raw' ), [1 , 1 , 1 , 3000 ])
160
+ assert_array_almost_equal (h .get_zooms (units = 'norm' ), [1 , 1 , 1 , 3 ])
156
161
for zooms in ((- 1 , 1 , 1 , 1 ),
157
162
(1 , - 1 , 1 , 1 ),
158
163
(1 , 1 , - 1 , 1 ),
0 commit comments