diff --git a/unit_tests/avwutils/fix_orient/feedsRun b/unit_tests/avwutils/fix_orient/feedsRun index a56d814bc001d75c5eabcd87764a4dc3281d8e7e..61cade721c7e6e8e17ee1567b4eb0cee4faa274d 100755 --- a/unit_tests/avwutils/fix_orient/feedsRun +++ b/unit_tests/avwutils/fix_orient/feedsRun @@ -99,6 +99,7 @@ def test_fix_orient(): fixed = nib.load('fixed.nii.gz') + new_data = fixed.get_fdata() new_qform, qcode = fixed.get_qform(coded=True) _, scode = fixed.get_sform(coded=True) @@ -107,6 +108,7 @@ def test_fix_orient(): assert qcode == 1 assert scode == 0 assert np.all(np.isclose(new_qform, np.diag([2, 2, 2, 1]))) + assert np.all(np.isclose(new_data, data.transpose((0, 2, 1)))) # An alternate strategy which involves @@ -126,12 +128,14 @@ def test_fix_orient_alternate(): sprun('imcp orig cleared') sprun('fslorient -deleteorient cleared') sprun('fslswapdim cleared x z y swapped') - sprun('imcp swapped fixed') - sprun('fslorient -setqform 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 fixed') + sprun('imcp swapped fixed1') + sprun('fslorient -setqform 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 fixed1') + sprun('imcp fixed1 fixed') sprun('fslorient -setqformcode 1 fixed') fixed = nib.load('fixed.nii.gz') + new_data = fixed.get_fdata() new_qform, qcode = fixed.get_qform(coded=True) _, scode = fixed.get_sform(coded=True) @@ -140,7 +144,7 @@ def test_fix_orient_alternate(): assert qcode == 1 assert scode == 0 assert np.all(np.isclose(new_qform, np.diag([2, 2, 2, 1]))) - + assert np.all(np.isclose(new_data, data.transpose((0, 2, 1)))) if __name__ == '__main__':