Skip to content

Commit 048c735

Browse files
committed
enh: add one test with concatenation of affines
1 parent cb7d41a commit 048c735

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nitransforms/tests/test_linear.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,11 @@ def test_Affine_to_x5(tmpdir, data_path):
114114
aff.reference = data_path / 'someones_anatomy.nii.gz'
115115
with h5py.File('withref-xfm.x5', 'w') as f:
116116
aff._to_hdf5(f.create_group('Affine'))
117+
118+
119+
def test_concatenation(data_path):
120+
"""Check concatenation of affines."""
121+
aff = ntl.Affine(reference=data_path / 'someones_anatomy.nii.gz')
122+
x = [(0., 0., 0.), (1., 1., 1.), (-1., -1., -1.)]
123+
assert np.all((aff + ntl.Affine())(x) == x)
124+
assert np.all((aff + ntl.Affine())(x, inverse=True) == x)

0 commit comments

Comments
 (0)