From 1607996f759835e4ebbc60d15875a7401e7e3b56 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 9 Oct 2024 20:19:52 -0400 Subject: [PATCH] FIX: Drop safeguard errors; manually verified weird references --- fmriprep/utils/transforms.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fmriprep/utils/transforms.py b/fmriprep/utils/transforms.py index 035d78f8..0b105d83 100644 --- a/fmriprep/utils/transforms.py +++ b/fmriprep/utils/transforms.py @@ -49,7 +49,8 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase: # * Always return a nitransforms TransformBase # * Construct warp affine from fixed parameters # - # This should be upstreamed into nitransforms + # This has been upstreamed into nitransforms. + # Future versions should switch to using nitransforms directly. h = h5py.File(filename) xform = ITKCompositeH5.from_h5obj(h) @@ -78,14 +79,6 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase: spacing = transform2['TransformFixedParameters'][6:9] direction = transform2['TransformFixedParameters'][9:].reshape((3, 3)) - # We are not yet confident that we handle anisotropic spacing - # or direction cosine ordering correctly. - # If we confirm or fix, we can remove these checks. - if not np.allclose(spacing, spacing[0]): - raise ValueError(f'Anisotropic spacing: {spacing}') - if not np.allclose(direction, direction.T): - raise ValueError(f'Asymmetric direction matrix: {direction}') - # ITK uses LPS affines lps_affine = compose_affine(T=origin, R=direction, Z=spacing) ras_affine = np.diag([-1, -1, 1, 1]) @ lps_affine