Warping streamlines/tractogram between dHCP individuals and the extended template


I am trying to warp a tractogram which I have run on an individual (using MRtrix) from the third release into the extended 40 week template space. However the streamlines are not being transformed correctly. I know that you need to use the inverse transform to warp the tracts (so use the warp from the template to the individual), and I believe(?) that it needs to be converted to a deformation field. I used the following commands:

warpconvert ./sub-CC00656XX13_ses-217601_from-extdhcp40wk_to-dwi_mode-image.nii.gz displacement2deformation ./warp_sub-CC00656XX13_ses-217601_2extdhcp40wk.nii.gz

tcktransform ./tracts.tck ./warp_sub-CC00656XX13_ses-217601_2extdhcp40wk.nii.gz ./extdhcp40wk_tracts.tck

and got this:

I have tried using the warps directly (i.e., not running warpconvert on them), using the non-inverted warps and none of these work.

I know the warps should work because I have used them with FSL’s img2imgcoord to correctly convert coordinates, so I presume there is some small trick I am missing or if I am using the wrong file? Looking at the first image, I feel like there is some mathematical transform that needs to be performed to get the tracts aligned? Am a bit stumped!




This is a tricky thing to do, here is a detailed step-by-step guide of how to do it. You are basically interested in the section Warping tracks files to MNI space using FSL warps. I hope this helps!

Best regards,