From 97ec31173124d8be903ae936e58a88fee1841e02 Mon Sep 17 00:00:00 2001 From: Keith Jamison Date: Tue, 14 May 2024 10:53:44 -0400 Subject: [PATCH] [FIX] Add "double" type to allowed DisplacementFieldTransform 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmriprep/utils/transforms.py b/fmriprep/utils/transforms.py index 0210f90f8..51a8a11a5 100644 --- a/fmriprep/utils/transforms.py +++ b/fmriprep/utils/transforms.py @@ -71,7 +71,7 @@ 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'