@@ -70,7 +70,7 @@ def test_read_mgh():
7070 assert h ['dof' ] == 0
7171 assert h ['goodRASFlag' ] == 1
7272 assert_array_equal (h ['dims' ], [3 , 4 , 5 , 2 ])
73- assert_almost_equal (h ['tr' ], 2 )
73+ assert_almost_equal (h ['tr' ], 2.0 )
7474 assert_almost_equal (h ['flip_angle' ], 0.0 )
7575 assert_almost_equal (h ['te' ], 0.0 )
7676 assert_almost_equal (h ['ti' ], 0.0 )
@@ -148,9 +148,14 @@ def test_write_noaffine_mgh():
148148def test_set_zooms ():
149149 mgz = load (MGZ_FNAME )
150150 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 ])
154159 for zooms in ((- 1 , 1 , 1 , 1 ),
155160 (1 , - 1 , 1 , 1 ),
156161 (1 , 1 , - 1 , 1 ),
0 commit comments