Skip to content

Commit ae1ad1d

Browse files
committed
TEST: More complete zoom testing, revert unnecessary change
1 parent b61d708 commit ae1ad1d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

nibabel/freesurfer/tests/test_mghformat.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_read_mgh():
7272
assert_equal(h['dof'], 0)
7373
assert_equal(h['goodRASFlag'], 1)
7474
assert_array_equal(h['dims'], [3, 4, 5, 2])
75-
assert_almost_equal(h['tr'], 2)
75+
assert_almost_equal(h['tr'], 2.0)
7676
assert_almost_equal(h['flip_angle'], 0.0)
7777
assert_almost_equal(h['te'], 0.0)
7878
assert_almost_equal(h['ti'], 0.0)
@@ -150,9 +150,14 @@ def test_write_noaffine_mgh():
150150
def test_set_zooms():
151151
mgz = load(MGZ_FNAME)
152152
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])
156161
for zooms in ((-1, 1, 1, 1),
157162
(1, -1, 1, 1),
158163
(1, 1, -1, 1),

0 commit comments

Comments
 (0)