Tcktransform combining several linear & non-linear transformation matrices

Hello,

I would like to register my tractogram from DWI-space to MNI-space using both my linear b0-T1 rigid registration as well as my non-linear T1-MNI registration. I struggle a bit with the correct order of applying the transformations. I have seen several post discussing something similar such as Registration: using transformations generated from other packages and Registration, transformation, regridding: concepts however, I could not find anything specifically dicussing the correct order of applying linear & non-linear transformations from several registration steps.

I did the following:

1.) Generate a deformation field warp of the reference image (MNI152 template):

warpinit MNI152_T1_1mm_brain.nii.gz inv_identity_warp[].nii.gz

2.) Apply the transformation warp to the identity warp:

for i in {0..2}; do
    antsApplyTransforms -d 3 \
    -i inv_identity_warp${i}.nii.gz \
    -o inv_mrtrix_warp${i}.nii.gz \
    -r b0_brain.nii.gz \
    -t "[T1_to_MNI152_0GenericAffine.mat, 1]" \
    -t T1_to_MNI152_1InverseWarp.nii.gz \
    -t "[b0_to_T1_rigid_0GenericAffine.mat, 1]" \
    --default-value 2147483647
done

3.) Fix warp:

warpcorrect inv_mrtrix_warp[].nii.gz inv_mrtrix_warp_corrected.mif -marker 2147483647

4.) Check if transformation worked by transforming the MNI152 template to input space:

mrtransform MNI152_T1_1mm_brain.nii.gz -warp inv_mrtrix_warp_corrected.mif MNI152_warped.mif 

5.) Transform .tck file to MNI152 space using inverse warp file:

tcktransform tck_ifod2_DWI.tck inv_mrtrix_warp_corrected.mif tck_DWI_to_2MNI.tck

Could you please clarify if the order of the transformation matrices applied in step 2 is correct?

Thank you for your help,

Franziska

Hi Franziska

If the non-linear warp field produced by ANTs registration already includes within it the influence of the estimated affine component, then composing that affine component with the non-linear warp field would involve an erroneous double application of that affine component.

If it were the case that the ANTs convention was to first apply the affine component and then apply the non-linear component, which would make sense given how these things are typically estimated, then I would expect for composition of the inverse transform to involve first applying the inverse of the non-linear warp field, and then the inverse of the affine matrix. However I think this potential misordering is obviated by above.

Rob