# Building tractography pipeline

**URL:** <https://community.mrtrix.org/t/building-tractography-pipeline/8739>\
**Category:** Uncategorized\
**Tags:** tractography\
**Created:** [April 10, 2026, 8:00pm UTC](https://community.mrtrix.org/t/building-tractography-pipeline/8739 "2026-04-10T20:00:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adambaker](https://community.mrtrix.org/user_avatar/community.mrtrix.org/adambaker/32/5499_2.png) [@adambaker](https://community.mrtrix.org/u/adambaker)\
**Post date:** [April 10, 2026, 8:00pm UTC](https://community.mrtrix.org/t/building-tractography-pipeline/8739/1 "2026-04-10T20:00:13Z")

</div>

Hi MRTrix team,

I am building my analysis pipeline and am curious your thoughts on my approach. My data are b=0,1000,2000.

I would like to implement ACT via `5ttgen`. I initially attempted `5ttgen fsl`, which worked for a non-lesioned brain, but was not accurate when run on a brain with a large lesion. I then found `5ttgen hsvs`, which uses the freesurfer outputs I have already computed. I added the flag `-white_stem` to classify the brainstem as white matter. However, in the description of `-white_stem`, it states that \*\*“\*\*streamlines will not be permitted to terminate within this region”.

The pathways I’m interested in terminate in the brainstem. Could you please confirm that if this option is selected, I would not be able to denote the pathway terminus regions as within the brainstem?

If I cannot, do you have alternative solutions to using `5ttgen`?

I appreciate the help!

My best,

Adam

---

<div class="post-metadata">

**Author:** ![adsouza](https://community.mrtrix.org/user_avatar/community.mrtrix.org/adsouza/32/4571_2.png) [@adsouza](https://community.mrtrix.org/u/adsouza)\
**Post date:** [April 12, 2026, 11:28pm UTC](https://community.mrtrix.org/t/building-tractography-pipeline/8739/2 "2026-04-12T23:28:20Z")

</div>

Hi Adam,  
Welcome to the forum!

When the brainstem is classified as white matter, ACT treats it as a non-terminal tissue type, and streamlines are therefore not permitted to terminate there. If pathways of interest terminate in the brainstem, the use of `-white_stem` is not appropriate, as such streamlines would be discarded.

An alternative is to omit the `-white_stem` option in the `5ttgen hsvs` command and allow the brainstem to be assigned to the 5th tissue type. In this case, ACT permits streamlines to terminate within the brainstem, which better reflects the intended anatomy.

Hope this helps 🙂  
Arkiev

---

<div class="post-metadata">

**Author:** ![adambaker](https://community.mrtrix.org/user_avatar/community.mrtrix.org/adambaker/32/5499_2.png) [@adambaker](https://community.mrtrix.org/u/adambaker)\
**Post date:** [April 13, 2026, 6:22pm UTC](https://community.mrtrix.org/t/building-tractography-pipeline/8739/3 "2026-04-13T18:22:14Z")

</div>

Arkiev,

Thank you for the reply - I really appreciate it!

Okay, I hear you. I am interested in the corticospinal tract (CST) and other motor pathways. The CST terminates in the spinal cord, but my MRI field of view doesn’t extend to spinal cord. Therefore, should I “force” the streamlines to terminate in the brain stem (essentially the end of my field of view), thus _not_ including the`-white_stem` flag? Or, since I know that CST terminates after the brain stem, which I cannot see in my brain MRI, should I still include `-white_stem`?

I originally had concern using`-white_stem` because of brainstem being classified as lesioned tissue (the fifth tissue type). I thought this classification would cause issues later in streamline generation.

I’m looking forward to hearing your thoughts. Thanks again for your time.

Adam

---

<div class="post-metadata">

**Author:** ![adsouza](https://community.mrtrix.org/user_avatar/community.mrtrix.org/adsouza/32/4571_2.png) [@adsouza](https://community.mrtrix.org/u/adsouza)\
**Post date:** [April 14, 2026, 3:21am UTC](https://community.mrtrix.org/t/building-tractography-pipeline/8739/4 "2026-04-14T03:21:46Z")

</div>

Hi Adam,

Assigning the brainstem to the 5th-tissue-type allows ACT to capture streamlines terminating both at the inferior border (i.e., the limit of the field of view) _and_ within the brainstem - thereby enabling investigation of bundles that genuinely terminate there. Conversely, if using `-white_stem` the latter would not be achievable. If I remember correctly, even if `-white_stem` is selected, streamlines can terminate at the inferior border since it is the end of the field of view (this needs verification…)

For the corticospinal tract, the true anatomical termination lies outside the field of view. As such, any classification of streamlines terminating at the inferior border of the brainstem necessarily involves an assumption, typically based on whether streamlines traverse expected superior regions and follow a plausible anatomical trajectory.

Regarding the 5th tissue type: although it is often associated with pathological or undefined tissue, ACT primarily treats it as a permissive compartment for streamline termination. It won’t “force” streamlines to terminate, rather, it will not discard streamlines based on the location of the endpoint. Assigning the brainstem to this class does not inherently introduce issues for tractography, provided the overall 5TT segmentation is anatomically reasonable

Cheers,  
Arkiev

---

<div class="post-metadata">

**Author:** ![adambaker](https://community.mrtrix.org/user_avatar/community.mrtrix.org/adambaker/32/5499_2.png) [@adambaker](https://community.mrtrix.org/u/adambaker)\
**Post date:** [June 24, 2026, 7:00pm UTC](https://community.mrtrix.org/t/building-tractography-pipeline/8739/5 "2026-06-24T19:00:47Z")

</div>

Hey Arkiev & MRtrix team,

Thank you for the detailed answer. I really appreciated this!

I came up with another question, specifically with `tcksample`.

Could you please confirm that when I run this over an FA map and output a `txt` file, that the columns are the data points, and the rows are the data values over the length of the tract? I am doing this like in the following lines of code.

```auto
tckresample -num_points 100 R_tract.tck R_tract_100.tck # resampling the tract to 100 "nodes".
tcksample R_tract_100.tck ./metrics/dti_fa.nii R_tract_100_fa.txt
# where dti_fa.nii is FA map of the entire brain.

```

Since the documentation for `tcksample` says: _“…with all values for each track on the same line)”_, I wanted to ensure that this meant column, instead of row. Indeed, my resulting `txt` file has 100 columns and ~2k rows, so I believe I am interpreting this correctly. Just wanted to make sure.

Thanks again for the help!

Adam
