Skip to content

Commit 23c4636

Browse files
committed
fix: Accept warps with isotropic spacing
1 parent 08933bf commit 23c4636

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fmriprep/utils/transforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
7878
spacing = transform2['TransformFixedParameters'][6:9]
7979
direction = transform2['TransformFixedParameters'][9:].reshape((3, 3))
8080

81-
# We are not yet confident that we handle non-unit spacing
81+
# We are not yet confident that we handle anisotropic spacing
8282
# or direction cosine ordering correctly.
8383
# If we confirm or fix, we can remove these checks.
84-
if not np.allclose(spacing, 1):
85-
raise ValueError(f'Unexpected spacing: {spacing}')
84+
if not np.allclose(spacing, spacing[0]):
85+
raise ValueError(f'Anisotropic spacing: {spacing}')
8686
if not np.allclose(direction, direction.T):
8787
raise ValueError(f'Asymmetric direction matrix: {direction}')
8888

0 commit comments

Comments
 (0)