Skip to content

Commit

Permalink
[FIX] Add "double" type to allowed DisplacementFieldTransform (#3287)
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
kjamison committed May 14, 2024
1 parent 391a0c2 commit 3dfd569
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fmriprep/utils/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 3dfd569

Please sign in to comment.