Skip to content

Commit 3dfd569

Browse files
authored
[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".
1 parent 391a0c2 commit 3dfd569

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fmriprep/utils/transforms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
7171
transform2 = h['TransformGroup']['2']
7272

7373
# Confirm these transformations are applicable
74-
if transform2['TransformType'][:][0] != b'DisplacementFieldTransform_float_3_3':
74+
if transform2['TransformType'][:][0] not in (
75+
b'DisplacementFieldTransform_float_3_3',
76+
b'DisplacementFieldTransform_double_3_3',
77+
):
7578
msg = 'Unknown transform type [2]\n'
7679
for i in h['TransformGroup'].keys():
7780
msg += f'[{i}]: {h["TransformGroup"][i]["TransformType"][:][0]}\n'

0 commit comments

Comments
 (0)