From 3dfd569814bd3e9fcccbf552740c31ac47a7961f Mon Sep 17 00:00:00 2001 From: Keith Jamison Date: Tue, 14 May 2024 14:05:15 -0400 Subject: [PATCH] [FIX] Add "double" type to allowed DisplacementFieldTransform (#3287) The ANTs utility `CompositeTransformUtil --assemble` outputs its displacement field as 'DisplacementFieldTransform_double_3_3', but utils/transform/load_ants_h5 throws an error unless it is 'DisplacementFieldTransform_float_3_3'. Presumably this is just a check to make sure it is a displacement field. The code after this check works fine for "double". --- fmriprep/utils/transforms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fmriprep/utils/transforms.py b/fmriprep/utils/transforms.py index 0210f90f8..7b36eb359 100644 --- a/fmriprep/utils/transforms.py +++ b/fmriprep/utils/transforms.py @@ -71,7 +71,10 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase: transform2 = h['TransformGroup']['2'] # Confirm these transformations are applicable - if transform2['TransformType'][:][0] != b'DisplacementFieldTransform_float_3_3': + if transform2['TransformType'][:][0] not in ( + b'DisplacementFieldTransform_float_3_3', + b'DisplacementFieldTransform_double_3_3', + ): msg = 'Unknown transform type [2]\n' for i in h['TransformGroup'].keys(): msg += f'[{i}]: {h["TransformGroup"][i]["TransformType"][:][0]}\n'