# Warping tractogram from native to template space and question about step argument with FACT or Tensor\_Det

**URL:** <https://community.mrtrix.org/t/warping-tractogram-from-native-to-template-space-and-question-about-step-argument-with-fact-or-tensor-det/4615>\
**Category:** Uncategorized\
**Tags:** tractography\
**Created:** [March 2, 2021, 1:47pm UTC](https://community.mrtrix.org/t/warping-tractogram-from-native-to-template-space-and-question-about-step-argument-with-fact-or-tensor-det/4615 "2021-03-02T13:47:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valery](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/v/a87d85/32.png) [@valery](https://community.mrtrix.org/u/valery)\
**Post date:** [March 2, 2021, 1:47pm UTC](https://community.mrtrix.org/t/warping-tractogram-from-native-to-template-space-and-question-about-step-argument-with-fact-or-tensor-det/4615/1 "2021-03-02T13:47:24Z")

</div>

Hi

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)

 ![Capture d’écran de 2021-03-02 11-43-28](https://community.mrtrix.org/uploads/default/original/2X/1/1fc3d1a22db64438b3fbcaca64ebbb85e5eb2dc9.png)

### after transformation (in template space)

 ![Capture d’écran de 2021-03-02 11-42-30](https://community.mrtrix.org/uploads/default/original/2X/2/29f92568c0f5101e6de3b325253533b7d4a74f82.png)

### here is the command line

```auto
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:

```auto
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

 ![Capture d’écran de 2021-03-02 11-48-30](https://community.mrtrix.org/uploads/default/original/2X/2/229a46544e61f105e6b629f2315b5a6160ded144.png)

### figure with FACT in blue and Tensor\_Prob in green

 ![Capture d’écran de 2021-03-02 11-48-38](https://community.mrtrix.org/uploads/default/original/2X/2/28b6f71ede68927e0fceb0989e2dcbccba380ba8.png)

Thanks in advance,  
Valéry

---

<div class="post-metadata">

**Author:** ![maxpietsch](https://community.mrtrix.org/user_avatar/community.mrtrix.org/maxpietsch/32/25_2.png) [@maxpietsch](https://community.mrtrix.org/u/maxpietsch)\
**Post date:** [March 2, 2021, 5:44pm UTC](https://community.mrtrix.org/t/warping-tractogram-from-native-to-template-space-and-question-about-step-argument-with-fact-or-tensor-det/4615/2 "2021-03-02T17:44:45Z")

</div>

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](https://community.mrtrix.org/t/registration-using-transformations-generated-from-other-packages/2259).

---

<div class="post-metadata">

**Author:** ![valery](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/v/a87d85/32.png) [@valery](https://community.mrtrix.org/u/valery)\
**Post date:** [March 4, 2021, 8:55pm UTC](https://community.mrtrix.org/t/warping-tractogram-from-native-to-template-space-and-question-about-step-argument-with-fact-or-tensor-det/4615/3 "2021-03-04T20:55:52Z")

</div>

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.
