Skip to content

Commit

Permalink
FIX: Tell nitransforms to load as FSL if not LTA
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 17, 2023
1 parent 2c2b8e3 commit 64922c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fmriprep/workflows/bold/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,10 @@ def compare_xforms(xfm_list, reference=None, moving=None, norm_threshold=15):
ref = nb.load(reference) if reference else None
mov = nb.load(moving) if moving else None

Check warning on line 679 in fmriprep/workflows/bold/registration.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/registration.py#L678-L679

Added lines #L678 - L679 were not covered by tests

bbr_affine = nt.linear.load(xfm_list[0], reference=ref, moving=mov).matrix
bbr_fname = xfm_list[0]
bbr_fmt = 'lta' if bbr_fname.endswith('.lta') else 'fsl'

Check warning on line 682 in fmriprep/workflows/bold/registration.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/registration.py#L681-L682

Added lines #L681 - L682 were not covered by tests

bbr_affine = nt.linear.load(bbr_fname, fmt=bbr_fmt, reference=ref, moving=mov).matrix
fallback_affine = nt.linear.load(xfm_list[1], reference=ref, moving=mov).matrix

Check warning on line 685 in fmriprep/workflows/bold/registration.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/registration.py#L684-L685

Added lines #L684 - L685 were not covered by tests

norm, _ = _calc_norm_affine([fallback_affine, bbr_affine], use_differences=True)
Expand Down

0 comments on commit 64922c7

Please sign in to comment.