# Streamlines tractography output problem

**URL:** <https://community.mrtrix.org/t/streamlines-tractography-output-problem/903>\
**Category:** Uncategorized\
**Created:** [May 17, 2017, 9:51pm UTC](https://community.mrtrix.org/t/streamlines-tractography-output-problem/903 "2017-05-17T21:51:34Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![SuperClear](https://community.mrtrix.org/user_avatar/community.mrtrix.org/superclear/32/2222_2.png) [@SuperClear](https://community.mrtrix.org/u/SuperClear)\
**Post date:** [November 10, 2017, 10:33am UTC](https://community.mrtrix.org/t/streamlines-tractography-output-problem/903/15 "2017-11-10T10:33:22Z")

</div>

Hi, Donald,

**1. ACT with data2(An example data)**

The FODs ( `HARDI150_WMvolume_fod.mif` ) is not in expected anatomical directions(as shown in Fig. 5.1).  
The 5TT image (`T1_HARDI150_5TT_nocrop.mif`) is shown in Fig.5.2.  
However, I cannot fix it by using `mrconvert -stride` command, I tried:

`mrconvert HARDI150.nii.gz -stride -1,2,3,4 HARDI150_StrideX.nii.gz` ( Fig.5.3 )  
` mrconvert HARDI150.nii.gz -stride 1,-2,3,4 HARDI150_StrideY.nii.gz` ( Fig.5.4 )  
` mrconvert HARDI150.nii.gz -stride -1,-2,3,4 HARDI150_StrideXY.nii.gz` ( Fig.5.5 )

I finally fix HARDI150 FODs by inverse the second column of ` HARDI150.bvecs` as shown in Fig 5.6 ( `HARDI150.bvecs` maybe not generated by Mrtrix3 ). Fig 5.7 shown the corpus callosum region. However, it is not able to generate the fibers in corpus callosum region( see Fig 5.9 and Fig 5.10 ).

Do you have any ideas? I still cannot find the solution.

* * *

**2. ACT with data1**

The `DTI_2013.bvecs` is created by Mrtrix3 command:  
`mrconvert 2013-02-06_10_56_37.0/ -export_grad_fsl DTI_2013.bvecs DTI_2013_bvals DTI_2013.nii.gz`

① In native anatomical space:  
`DTI_2013.nii.gz` is 4D image and t1\_2013.nii.gz is the corresponding 3D image. I use the original data: ( `DTI_2013.nii.gz / t1_2013.nii.gz` ) to generate the fod image ( `DTI_2013_fod.mif` ) , the fod image correctly shows the anatomical direction, see Fig 6.1.

Then I do `recon-all` command of FreeSurfer to generate cortical parcellations of `t1_2013.nii.gz`. In this way, the `t1_2013.nii.gz` data will naturally go to FreeSurface space ( `t1_2013_freesurfer.nii.gz` ) . So I register `DTI_2013.nii.gz` to `DTI_2013_freesurfer.nii.gz`, [following Lucius’s instruction](http://community.mrtrix.org/t/registration-of-structural-and-diffusion-weighted-data/203/22), They seems registered nicely, see Fig 6.2:

> A. Register DTI\_b0 to T1\_freesurfer:
> 
> flirt -in DTI\_2013\_b0.nii.gz -ref t1\_2013\_freesufer\_skulled.nii.gz -omat DTI\_2013\_b0\_to\_t1\_2013\_freesurf\_skulled.mat
> 
> flirt -in DTI\_2013\_b0.nii.gz -ref t1\_2013\_freesufer\_skulled.nii.gz -applyxfm -init DTI\_2013\_b0\_to\_t1\_2013\_freesurf\_skulled.mat -out DTI\_2013\_b0\_freesurfer.nii.gz
> 
> B. Register DTI to T1\_freesurfer:
> 
> flirt -in DTI\_2013.nii.gz -ref t1\_2013\_freesufer\_skulled.nii.gz -applyxfm -init DTI\_2013\_b0\_to\_t1\_2013\_freesurf\_skulled.mat -out DTI\_2013\_freesurfer.nii.gz

② In FreeSurfer space:  
I use the data (` DTI_2013_freesurfer.nii.gz/ t1_2013_freesurfer.nii.gz` ) to generate the fod image (`DTI_2013_freesurfer_fod.mif`), From then on, the fod image can not correctly indicate the anatomical direction, see Fig 6.3. You can find the tensors on the top half the region of corpus callosum are incorrect. (It seems half of the orientation is correct and the other half goes wrong).

③ In MNI152 space:  
Then I use the similar registration command to register (`DTI_2013_freesurfer.nii.gz/ t1_2013_freesurfer.nii.gz`) to MNI152 space. The fod image ( `DTI_2013_freesurfer_in_MNI152_fswm_fod.mif` ) certainly incorrectly indicates the anatomical direction, as shown in Fig 1.3.

Does it mean I did wrong registration? I tried `mrconvert -stride` and inverse the second collum of bvecs, the output fod images maintain wrong. I hope to know how does it happen and expect to figure it out.

Sweet Thanks,  
Chaoqing

* * *

Fig 5.1 ( HARDI150\_WMvolume\_fod.mif )

 ![HARDI150_WMvolume_fod](https://community.mrtrix.org/uploads/default/original/1X/b55aca1a8baaf0115a00035068dbbd6c6e987ae1.png)

Fig 5.2 ( T1\_HARDI150\_5TT\_nocrop.mif )

 ![mif](https://community.mrtrix.org/uploads/default/original/1X/107a23e4ce1be23642102994268c3bdd453ff715.jpg)

Fig 5.3 ( HARDI150\_StrideX\_WMvolume\_fod.mif )

 ![HARDI150_Stride_X_WMvolume_fod](https://community.mrtrix.org/uploads/default/original/1X/2742c2c5814116324c317d7639d6339a571f5afc.jpg)

Fig 5.4 ( HARDI150\_StrideY\_WMvolume\_fod.mif )

 ![](https://community.mrtrix.org/uploads/default/original/1X/edbf857f10c4fdb724fec6cdf6e28c6199afd94a.jpg)

Fig 5.5 (HARDI150\_StrideXY\_WMvolume\_fod.mif )

 ![HARDI150_StrideY_WMvolume_fod](https://community.mrtrix.org/uploads/default/original/1X/e3eb57c103881d19a4a227413add53328aa0513b.jpg)

Fig 5.6 (HARDI150\_bvecInverseY\_WMvolume\_fod.mif )

 ![HARDI150_bvecconvertY_WMvolume_fod_01](https://community.mrtrix.org/uploads/default/original/1X/ccff3e87a35dd12eac04ed3f17991be4c6cf909e.jpg)

Fig 5.7 (HARDI150\_bvecInverseY\_WMvolume\_fod.mif )

 ![HARDI150_bvecconvertY_WMvolume_fod_02](https://community.mrtrix.org/uploads/default/original/1X/709c12845c63e9bb1a6eeac73732ad734851a84a.jpg)

Fig 5.8  
( T1\_HARDI150\_5TT\_nocrop.mif and T1\_HARDI150\_5TT\_nocrop\_WMvolume\_3D\_HARDItemplate.nii.gz )

 ![T1_HARDI150_5TT_nocrop && T1_HARDItemplate](https://community.mrtrix.org/uploads/default/original/1X/c2567a3904aa98283ef369612d311d5c899722b8.jpg)

Fig 5.9 ( HARDI150\_bvecInverseY\_WMvolume\_act\_0.1M\_backtrack.tck )

 ![WMmask](https://community.mrtrix.org/uploads/default/original/1X/9ff409277690a7c89da17e38a5cbf05fbca37eac.jpg)

Fig 5.10 ( HARDI150\_bvecInverseY\_WMvolume\_act\_0.1M\_backtrack.tck )

 ![1M_backtrack](https://community.mrtrix.org/uploads/default/original/1X/f851b9370fa362c9ddc78896dfde26f29e24ab05.jpg)

[ACT commands]:

> 1. dwi2response tournier -fslgrad HARDI150\_InverseY.bvecs HARDI150.bvals HARDI150.nii.gz HARDI150\_bvecInverseY\_response.txt
> 
> 2. dwi2fod csd HARDI150.nii.gz HARDI150\_bvecInverseY\_response.txt HARDI150\_bvecInverseY\_WMvolume\_fod.mif -mask T1\_HARDI150\_5TT\_nocrop\_WMvolume\_3D\_HARDItemplate.nii.gz -fslgrad HARDI150\_InverseY.bvecs HARDI150.bvals
> 
> 3. tckgen -act T1\_HARDI150\_5TT\_nocrop.mif HARDI150\_bvecInverseY\_WMvolume\_fod.mif HARDI150\_bvecInverseY\_WMvolume\_act\_0.1M\_backtrack.tck -crop\_at\_gmwmi -seed\_gmwmi T1\_HARDI150\_5TT\_nocrop\_gmwmi.mif -backtrack -select 100000

* * *

Fig 6.1 ( DTI\_2013\_fod )

 ![DTI_2013_fod](https://community.mrtrix.org/uploads/default/original/1X/7d3431206e82165759fd3e3e7e9544ff76de879a.png)

Fig. 6.2 ( mrview : T1, DTI, WM, 5TT image in FreeSurfer space)

 ![wm](https://community.mrtrix.org/uploads/default/original/1X/0c472a92ffa2cab91b1488952469a1857b15ba3f.jpg)

Fig 6.3 ( DTI\_2013\_freesurfer\_fod.mif )

 ![DTI_2013_in_t1_2013_freesurfer_skulled_5ttwm_fod](https://community.mrtrix.org/uploads/default/original/1X/92df70eb1aa36eaabc50cd145f08c4fd35701811.jpg)

* * *

---

_[View the full topic](https://community.mrtrix.org/t/streamlines-tractography-output-problem/903)._
