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