Skip to content

Commit f581725

Browse files
mihmatthew-brett
authored andcommitted
TST: Verify PARREC affines differ in the right places
This does not address the issue mentioned in nipygh-227 that Philips own NIfTI conversion yields a different offset column in the affine.
1 parent 7a28d48 commit f581725

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nibabel/tests/test_parrec.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,14 @@ def test_orientation():
6060
hdr_defc['slice orientation'] = 3
6161
hdr = PARRECHeader(HDR_INFO, hdr_defc)
6262
assert_equal(hdr.get_slice_orientation(), 'coronal')
63+
64+
def test_affine():
65+
hdr = PARRECHeader(HDR_INFO, HDR_DEFS)
66+
default = hdr.get_affine()
67+
scanner = hdr.get_affine(origin='scanner')
68+
fov = hdr.get_affine(origin='fov')
69+
assert_array_equal(default, scanner)
70+
# rotation part is same
71+
assert_array_equal(scanner[:3, :3], fov[:3,:3])
72+
# offset not
73+
assert_false(np.all(scanner[:3, 3] == fov[:3, 3]))

0 commit comments

Comments
 (0)