Skip to content

Commit 4c8f043

Browse files
authored
enh: add test to cover new lines
1 parent 3a5467f commit 4c8f043

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 3dvolreg matrices (DICOM-to-DICOM, row-by-row):
2+
0.999999 -0.000999999 -0.001 -4 0.00140494 0.621609 0.783327 -2 -0.000161717 -0.783327 0.62161 -1
3+
0.999999 -0.000999999 -0.001 -4 0.00140494 0.621609 0.783327 -2 -0.000161717 -0.783327 0.62161 -1

nitransforms/tests/test_io.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_LT_conversions(data_path, fname):
180180
"oblique",
181181
],
182182
)
183-
@pytest.mark.parametrize("sw", ["afni", "fsl", "fs", "itk"])
183+
@pytest.mark.parametrize("sw", ["afni", "fsl", "fs", "itk", "afni-array"])
184184
def test_Linear_common(tmpdir, data_path, sw, image_orientation, get_testdata):
185185
tmpdir.chdir()
186186

@@ -206,6 +206,9 @@ def test_Linear_common(tmpdir, data_path, sw, image_orientation, get_testdata):
206206

207207
fname = f"affine-{image_orientation}.{sw}{ext}"
208208

209+
if sw == "afni-array":
210+
fname.replace(image_orientation, "RAS")
211+
209212
# Test the transform loaders are implemented
210213
xfm = factory.from_filename(data_path / fname)
211214

@@ -222,6 +225,9 @@ def test_Linear_common(tmpdir, data_path, sw, image_orientation, get_testdata):
222225

223226
# Test from_ras
224227
RAS = from_matvec(euler2mat(x=0.9, y=0.001, z=0.001), [4.0, 2.0, -1.0])
228+
if sw == "afni-array":
229+
RAS = [RAS, RAS]
230+
225231
xfm = factory.from_ras(RAS, reference=reference, moving=moving)
226232
assert np.allclose(xfm.to_ras(reference=reference, moving=moving), RAS)
227233

0 commit comments

Comments
 (0)