Skip to content

Commit 344b1ce

Browse files
committed
TEST: Verify that adding Transform arrays to a chain does not explode
1 parent e9b46cf commit 344b1ce

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

nitransforms/tests/test_linear.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ def test_loadsave_itk(tmp_path, data_path, testdata_path):
8282
)
8383

8484

85+
def test_mapping_chain(data_path):
86+
xfm = nitl.load(data_path / "itktflist2.tfm", fmt="itk")
87+
xfm = nitl.load(data_path / "itktflist2.tfm", fmt="itk")
88+
assert len(xfm) == 9
89+
90+
# Addiition produces a chain
91+
chain = xfm + xfm
92+
# Length now means number of transforms, not number of affines in one transform
93+
assert len(chain) == 2
94+
# Just because a LinearTransformsMapping is iterable does not mean we decompose it
95+
chain += xfm
96+
assert len(chain) == 3
97+
98+
8599
@pytest.mark.parametrize(
86100
"image_orientation",
87101
[

0 commit comments

Comments
 (0)