Convert ANTs to FNIRT

Hi,

For my pipeline I use FSL and ANTs and at some point I was converting the ANTs transformations to FSL by doing this:

c3d_affine_tool -ref Template_T2w.nii.gz -src T2w.nii.gz -itk ants_str2Template_0GenericAffine.mat -ras2fsl -o ants_str2Template_affine_flirt.mat

c3d -mcs ants_str2Template_1Warp.nii.gz -oo ants_str2Template_wx.nii.gz ants_str2Template_wy.nii.gz ants_str2Template_wz.nii.gz

fslmaths ants_str2Template_wy -mul -1 ants_str2Template_i_wy

fslmerge -t ants_str2Template_warp_fnirt ants_str2Template_wx ants_str2Template_i_wy ants_str2Template_wz

convertwarp --ref=Template_T2w.nii.gz --premat=ants_str2Template_affine_flirt.mat --warp1=ants_str2Template_warp_fnirt --out=str2Template_warp

This works for my dataset. Reading about if this was the correct way to do it, I found another possibility using connectome workbench:

c3d_affine_tool -ref Template_T2w.nii.gz -src T2w.nii.gz -itk ants_str2Template_0GenericAffine.mat -ras2fsl -o ants_str2Template_affine_flirt.mat

wb_command -convert-warpfield -from-itk ants_str2Template_1Warp.nii.gz -to-fnirt ants_str2Template_warp_fnirt Template_T2w.nii.gz

convertwarp --ref=Template_T2w.nii.gz --premat=ants_str2Template_affine_flirt.mat --warp1=ants_str2Template_warp_fnirt --out=str2Template_warp

The results look identical, but they have some differences in the last decimal numbers in some voxels. My question is: are both methods equivalent in general? or the first case only works in this case because it assumes the images to be in a certain orientation and in this case is true? Thanks in advance.

Best regards,

Manuel

Hi,
I encountered the same issue as you. I would like to ask if you have finally confirmed that using following codes to convert ANTs transformations to FSL with the c3d toolkit is correct?

Hi,

I’m using the second approach and I don’t have any issues. I remember doing some experiments when this was not properly working, depending of the orientation of the data, but I can’t remember the exact details now.

For the datasets I have it works fine.

Best regards,

Manuel