# The input of 5ttgen in RC3 version

**URL:** https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861
**Category:** Uncategorized
**Created:** [August 27, 2018, 7:32am UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861 "2018-08-27T07:32:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![liyuan\_yang](https://community.mrtrix.org/user_avatar/community.mrtrix.org/liyuan_yang/32/345_2.png) [@liyuan\_yang](https://community.mrtrix.org/u/liyuan_yang)
#### Post date: [August 27, 2018, 7:32am UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861/1 "2018-08-27T07:32:44Z")

</div>

Hi everyone  
I felt confused about the input of 5ttgen in RC3 version.  
In the document of ACT, ''My personal preference is to register the T1-contrast anatomical image to the diffusion image series before any further processing of the T1 image is performed.- **Image registration** ‘’,but ‘‘The `5ttgen` script using the `fsl` algorithm interfaces with FSL to generate the necessary image data from the raw T1 image, using BET, FAST and FIRST.- **Tissue segmentation** ’’,  
**So I wonder the input of 5ttgen is raw T1 image or T1 image coregistered to diffusion image ?**  
[https://mrtrix.readthedocs.io/en/latest/quantitative\_structural\_connectivity/act.html](https://mrtrix.readthedocs.io/en/latest/quantitative_structural_connectivity/act.html)

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 27, 2018, 8:33am UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861/2 "2018-08-27T08:33:04Z")

</div>

Definitely the co-registered T1 – otherwise the output 5TT image will also not be registered to the dMRI data, which will cause issues for e.g. tracking with ACT.

It is possible to run `5ttgen` on the raw T1 and then apply the same transformation to the output 5TT image as would be required to register the T1 to the dMRI – but it’s a fair bit simpler and less error-prone just to ensure the T1 is already co-registered…

---

<div class="post-metadata">

### Author: ![liyuan\_yang](https://community.mrtrix.org/user_avatar/community.mrtrix.org/liyuan_yang/32/345_2.png) [@liyuan\_yang](https://community.mrtrix.org/u/liyuan_yang)
#### Post date: [August 27, 2018, 8:59am UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861/3 "2018-08-27T08:59:38Z")

</div>

I agree with your idea, but when I run the command 5ttgen T12FA.nii 5tt.nii -premasked there were warnings…  
5ttgen: [WARNING] **Voxel size larger than expected for T1-weighted images ([2.0, 2.0, 2.0]); note that ACT does not require re-gridding of T1 image to DWI space, and indeed retaining the original higher resolution of the T1 image is preferable**  
Command: mrconvert input.mif T1.nii -strides -1,+2,+3  
Command: fast T1.nii  
5ttgen: [WARNING] Generating 1mm isotropic T1 image for FIRST in hope of preventing failure, since input image is of lower resolution  
Command: mrresize T1.nii T1\_1mm.nii -voxel 1.0 -interp sinc  
Command: run\_first\_all -m none -s L\_Accu,R\_Accu,L\_Caud,R\_Caud,L\_Pall,R\_Pall,L\_Puta,R\_Puta,L\_Thal,R\_Thal,L\_Amyg,R\_Amyg,L\_Hipp,R\_Hipp -i T1\_1mm.nii -o first -b

Cheers  
Liyuan

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 27, 2018, 9:46am UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861/4 "2018-08-27T09:46:58Z")

</div>

OK, if you’re using `flirt` to apply the transformation, it will by default regrid to match the target image (the DWI in this case); you need to avoid that. See [this post](https://community.mrtrix.org/t/5ttgen-waiitng-for-creation-of-new-file/1044/3?u=jdtournier) for more details.

---

<div class="post-metadata">

### Author: ![liyuan\_yang](https://community.mrtrix.org/user_avatar/community.mrtrix.org/liyuan_yang/32/345_2.png) [@liyuan\_yang](https://community.mrtrix.org/u/liyuan_yang)
#### Post date: [August 29, 2018, 2:01am UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861/5 "2018-08-29T02:01:29Z")

</div>

Hi  
I have read [the post](https://community.mrtrix.org/t/5ttgen-waiitng-for-creation-of-new-file/1044).

“Registration of T1 image to DWIs using FSL `flirt` . In its default usage, `flirt`_resamples_ the input image to match the target image. This is _unnecessary_ for ACT. **It is better to have `flirt` provide the calculated transformation matrix, then _apply_ that linear transformation to the T1 image (either using `flirt` again, or combination of `transformconvert` and `mrtransform` ), such that the image header transformation is altered but the image grid / intensities are not**”

I am a little confused about how to ues the **flirt** to achieve the goal (the image header transformation is altered but the image grid / intensities are not)?

Besides I want to confirm the combination **transformconvert T1BET2FA.mat T1BET.nii FA.nii flirt\_import T12FAMrtrix** and **mrtransform 5TT.nii 5TT2FA.nii -linear T12FAMrtrix** is correct?

Cheers  
Liyuan

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 31, 2018, 1:07pm UTC](https://community.mrtrix.org/t/the-input-of-5ttgen-in-rc3-version/1861/6 "2018-08-31T13:07:01Z")

</div>

I can’t recall how to get `flirt` to apply the transformation without regridding, but I’m pretty sure it was a two-step process: a `flirt` call to estimate the transformation, and a subsequent call to `flirt -applyxfm` to apply the transformation as such. You’ll need to consult the FSL docs for details…

Otherwise, I _think_ your `transformconvert` / `mrtransform` invocation is correct, but as always, you best bet is to try it and verify that it performs as expected…
