Tck in MNI space

Dear Mrtrix experts,
I followed the steps proposed by @eloydelas in 2016 “Warping tck files using ANTS warps” to normalize my tracts to MNI space. I didn’t get any error and my tck fils is now in MNI space; however, I didn’t get the stunning registration that @eloydelas had. Just wondering if you have more recent recommendation to make this even better.
MNI
Thanks a lot for making this great software available!! Amelia

Dear Amelia,

Only one consideration in the proposed method to normalize tracts to MNI space. The qform and sform codes could be different after processing the images. It is essential to handle correctly the header information. To avoid this problem you could just use the option of fsl “copysfrom2qform” in fslorient.

All the best,

Eloy

Thank you so much @eloydelas! Your suggestion significantly improved my results!
Best, Amelia

Dear Eloy and MRtrixers,

Thank you for the great work to transform tck into MNI space. In general, it works like magic.

Recently, I had some problem with the routine you recommended. In brief, skull end of some fibers connected to a certain area, the bottom of medulla in the attached example, after the transformation.

These are deterministic tractography output used for visualization purpose. I didn’t detect any problems in the native tracts. Could you please help to solve this problem? Thank you very much in advance!

Stay Healthy, Stay Happy!

Best regards,

Yong!

Did you use warps generated with other software? If so, an erroneously interpreted out-of-bounds value might be causing this. Have a look here, in particular, you might need to set the -marker option to warpcorrect.

Thanks for your reply. It took a while till my administrator installed the latest mrtrix3.

Indeed, I used ANT 3 to create the warps (please see the complete commands below):

ANTS 3 -m CC[$FSLDIR/data/standard/MNI152_T1_1mm.nii.gz,$filepath/$t1,1,5] -t SyN[0.5] -r Gauss[2,0] -o $filepath/T1_to_MNI_synants.nii -i 30x90x20 --use-Histogram-Matching
warpinit $mni $filepath/flirtMNI-[].nii -force
for i in 0 1 2;do
WarpImageMultiTransform 3 $filepath/flirtMNI-${i}.nii $filepath/flirtMNI2tck-${i}.nii -R $mni -i $filepath/T1_to_MNI_synantsAffine.txt $filepath/T1_to_MNI_synantsInverseWarp.nii
done
warpcorrect $filepath/flirtMNI2tck-[].nii $filepath/flirtMNI2tck_corr.mif -marker 2147483647 -force
tcktransform $filepath/$tck $filepath/flirtMNI2tck_corr.mif $filepath/$mnitck -quiet -force

I reprocessed the tract file but the problem is persist (see the output message below);
warpcorrect: [WARNING] no out of bounds voxels found with value (2.14748365e+09,2.14748365e+09,2.14748365e+09)

What shall I do to solve the problem? Thank you.

Stay healthy and stay happy!

Best regards,

Yong

The original format of the deterministic fibers is vtk. I convert it by ‘tckconvert fibs.vtk fibs.vtk.tck’. Hope it helps to solve the problem. Appreciate it!

Best, Yong

I think there’s two possibilities here:

warpcorrect $filepath/flirtMNI2tck-.nii $filepath/flirtMNI2tck_corr.mif -marker 2147483647 -force

The out-of-bounds marker value (2147483647 in the example) needs to be replaced with whatever value the software you have used has placed into the image data for out-of-bounds regions. You need to check your own data and see what values are stored there, and use that value in this command call.

If this is not the source of the issue, it’s possible that there’s an issue with looking for precise equivalence of floating-point values, which is always dangerous; but I’ll wait to see if the problem is solved by the first suggestion before expanding on the second.

I’d advise against using the deprecated command WarpImageMultiTransform but instead use the command antsApplyTransforms for these reasons: docs: warping via WarpImageMultiTransform · Issue #1551 · MRtrix3/mrtrix3 · GitHub

As of 3.0.0 can do that by increasing warpcorrect’s -tolerance option value.

1 Like