Skip to content

Commit

Permalink
TEST: Update test to account for minor differences with nitransforms
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 17, 2023
1 parent 9f8a1fc commit 4452fb0
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions niworkflows/interfaces/tests/test_itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,26 @@ def test_MCFLIRT2ITK(tmp_path):
assert out_file.exists()
lines = out_file.read_text().splitlines()

assert lines[:3] == [
assert lines[:2] == [
"#Insight Transform File V1.0",
"#Transform 0",
"Transform: MatrixOffsetTransformBase_double_3_3",
]
assert lines[2] in (
"Transform: MatrixOffsetTransformBase_double_3_3",
"Transform: AffineTransform_float_3_3",
)
assert lines[3].startswith("Parameters: ")
assert lines[4:7] == [
"FixedParameters: 0 0 0",
"#Transform 1",
assert lines[4] == "FixedParameters: 0 0 0"
offset = 1 if lines[5] == "" else 0
assert lines[5 + offset] == "#Transform 1"
assert lines[6 + offset] in (
"Transform: MatrixOffsetTransformBase_double_3_3",
]
assert lines[7].startswith("Parameters: ")
"Transform: AffineTransform_float_3_3",
)
assert lines[7 + offset].startswith("Parameters: ")

params0 = np.array([float(p) for p in lines[3].split(" ")[1:]])
params1 = np.array([float(p) for p in lines[7].split(" ")[1:]])
params1 = np.array([float(p) for p in lines[7 + offset].split(" ")[1:]])
# Empirically determined
assert np.allclose(
params0,
Expand Down

0 comments on commit 4452fb0

Please sign in to comment.