Warping tractogram from native to template space and question about step argument with FACT or Tensor_Det


I’m looking for help for two different issues, I’m a beginner in tractography so please excuse my naive questions.

Question 1

I wish to warp a tractogram computed in native space to template space. I’m using transform files from ANTs and the corresponding MRtrix documentation .

  • I checked the warpinit/ antsApplyTransforms /warpcorrect process with the images in native or template space and everything is fine. I can switch from Template → Native or Native to Template using mrtransform -warp.
  • Using the tractogram , the results seems fine at first glance (I mean the position in space after warping) except for some tracks where I have some strange orientation. I’m suspecting a voxel resolution issue. I’m working with tensors , there are no ODFs in the processing.

before transform (in native space)

after transformation (in template space)

here is the command line

tckgen dwi_den_modified.mif -algorithm Tensor_Prob -select 5000 -step 0.2 -angle 10 -cutoff 0.15 -maxlength 20 -minlength 1 -seed_image 16_Versus_Tracto//ROI.mif ${TRACTO_NAME} --force

tcktransform ${TRACTO_NAME} ${FOLDER_TRACTO_16}/inv_mrtrix_${NUM}_warp_corrected.mif ${TRACTO_MOVED_TO_T} --force

I’m using either FACT or Tensor_Prob of Tensor_Det but I’m not sure which step size should I use for each algorithm . The dwi , tensor and warps have a voxel resolution of 0.3 mm3

Question 2

I wish to compare the following algorithm in native space : FACT, Tensor_Det & Tensor_Prob. Tensor_Det and Tensor_Prob give the same results but FACT differs a lot . Is there any tricks to match the tensor Prob algorithm ? Here is the command I use:

tckgen v1_1.nii.gz -algorithm FACT -select 5000 -step 0.2 -angle 10 -cutoff 0.15 -maxlength 20 -minlength 1 -seed_image 16_Versus_Tracto//ROI.mif 16_Versus_Tracto//Streamlines/stream_1_FACT_s5000_a20_angle10_co_l40.tck --force
tckgen dwi_den_modified.mif -algorithm Tensor_Prob -select 5000 -step 0.2 -angle 10 -cutoff 0.15 -maxlength 20 -minlength 1 -seed_image 16_Versus_Tracto/ROI.mif 16_Versus_Tracto//Streamlines/stream_1_PROB_s5000_a20_angle10_co_l40.tck --force

figure with FACT in blue

figure with FACT in blue and Tensor_Prob in green

Thanks in advance,

Regarding question 1, this looks like an out-of-bounds issue. You might want to set --default-value for antsApplyTransforms and -marker in warpcorrect and verify that the these areas are labelled with NaN in the corrected warp as described in Registration: using transformations generated from other packages.

Thanks Max, I double checked the instructions and I found my mistake.
I was applying the -marker option but I made a mistake in the computation of the inverse warp. In the step with antsApplyTransforms, I was using the wrong reference: I forget to switch the reference from fixed image to the moved image. I have two another questions but I open a threads.