Skip to content

Commit

Permalink
[FIX] Add "double" type to allowed DisplacementFieldTransform
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 authored May 14, 2024
1 parent 391a0c2 commit 97ec311
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fmriprep/utils/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 97ec311

Please sign in to comment.