# Fixel Based Analyses in Given Tract

**URL:** <https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390>\
**Category:** Uncategorized\
**Tags:** fba\
**Created:** [November 21, 2021, 11:51pm UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390 "2021-11-21T23:51:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![smeisler](https://community.mrtrix.org/user_avatar/community.mrtrix.org/smeisler/32/3620_2.png) [@smeisler](https://community.mrtrix.org/u/smeisler)\
**Post date:** [November 21, 2021, 11:51pm UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/1 "2021-11-21T23:51:15Z")

</div>

Hi,

Really excited to try running an FBA. In addition to running an FBA on the entire fixel grid, I want to try running an FBA within a given tract. I primarily use TractSeg for tract segmentation/reconstruction. I see three potential ways to get a tract mask to use for FBA.

1. Run TractSeg in native space → warp masks to template → find intersection of all subjects’ tract masks
2. Warp FODs to template → run TractSeg in template space → find intersection of all subjects’ tract masks
3. Run TractSeg on group composite FOD Template

I think I can safely rule out 3, since my cohort has 900 subjects and my template would be built off of 30-40 subjects.

From what I can tell, [a recent preprint](https://www.biorxiv.org/content/10.1101/2021.11.19.469248v1) did method 2 (run TractSeg on subject-wise FODs/peaks in template space). Do you think this is the right way to go about this?

Thanks,  
Steven

---

<div class="post-metadata">

**Author:** ![smeisler](https://community.mrtrix.org/user_avatar/community.mrtrix.org/smeisler/32/3620_2.png) [@smeisler](https://community.mrtrix.org/u/smeisler)\
**Post date:** [November 22, 2021, 1:26am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/2 "2021-11-22T01:26:17Z")

</div>

I just found this in the supplement to the [FBA Dhollander et al., 2021 paper](https://www.sciencedirect.com/science/article/pii/S1053811921006923#bib0079):

> The TractSeg software (Wasserthal et al.,2018; [GitHub - MIC-DKFZ/TractSeg: Automatic White Matter Bundle Segmentation](https://github.com/MIC-DKFZ/TractSeg)) allows for automated accurate tract segmentation (e.g., when applied to the FBA study-specific FOD template), the output of which can be used, e.g., to label FBA results or to extract tract-averaged metrics

Does this imply that option 3 (run TractSeg on the group-composite FOD image) is recommended? Is this true even if only a subset of subjects are used to make the template?

Thanks,  
Steven

---

<div class="post-metadata">

**Author:** ![m.bart](https://community.mrtrix.org/user_avatar/community.mrtrix.org/m.bart/32/3589_2.png) [@m.bart](https://community.mrtrix.org/u/m.bart)\
**Post date:** [November 22, 2021, 10:43am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/3 "2021-11-22T10:43:56Z")

</div>

Hi smeisler,

Well, I would say it depends a little bit on how you are using TractSeg. Output can be binary voxel mask or tractography file. For the first, I would say, you can go with a number 1. However, if you get tracography files as an output of TractSeg (better in my opinion), you can convert this to fixels and create fixel mask (better then just a plane voxel mask) and use it for a way better tract analysis, since you can use only a certain fixels not a whole voxel as with a voxel mask. In this case, since it is important to have uniformity to compare what is comparable, I would run TractSeg on a template and ten mask FODs warped to the template, to use tracts that are “build” from same fixels for all subjects.

But take it only as my personal opinion. Good luck 🙂

---

<div class="post-metadata">

**Author:** ![smeisler](https://community.mrtrix.org/user_avatar/community.mrtrix.org/smeisler/32/3620_2.png) [@smeisler](https://community.mrtrix.org/u/smeisler)\
**Post date:** [November 22, 2021, 2:10pm UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/4 "2021-11-22T14:10:04Z")

</div>

Hi @m.bart,

Thanks for the response! I agree about the tractography vs. voxel mask point; I initially thought in terms of voxels because in the FBA pipeline that’s how the initial brain masks are calculated (voxel-wise intersection of all subject brain masks), but realize a tract fixel mask would be more specific. In this case, yes I agree these can be produced in template space using the reoriented FODs. The point I am still unsure of is the last sentence, where (at least in my case with a huge cohort) the masks wouldn’t come from all subjects. Maybe I am overthinking this step and placing too much weight on it; curious to hear what anyone else thinks!

Best,  
Steven

---

<div class="post-metadata">

**Author:** ![smeisler](https://community.mrtrix.org/user_avatar/community.mrtrix.org/smeisler/32/3620_2.png) [@smeisler](https://community.mrtrix.org/u/smeisler)\
**Post date:** [November 22, 2021, 7:33pm UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/5 "2021-11-22T19:33:19Z")

</div>

Hi @m.bart (and general mrtrix community 🙂 ),

Following up here, but I can see two potential ways to proceed, and I don’t know if one is better (or valid/invalid). This is based on the [FBA pipeline tutorial](https://mrtrix.readthedocs.io/en/3.0.3/fixel_based_analysis/mt_fibre_density_cross-section.html).

1. Changing step 12 and generating the white matter fixel mask from the template-space track segmentation instead of the whole brain mask. This would be using the **voxel-wise** TractSeg tract segmentations. This fixel mask would be propagated through the rest of the tutorial.

2. Change step 21 and generate the fixel-fixel connectivity matrix using the tract-specific **.trk file** instead of the whole brain tractogram. This matrix would be propogated through the rest of the tutorial.

Any guidance would be much appreciated, thanks!

Best,  
Steven

---

<div class="post-metadata">

**Author:** ![kittyzhu](https://community.mrtrix.org/user_avatar/community.mrtrix.org/kittyzhu/32/3572_2.png) [@kittyzhu](https://community.mrtrix.org/u/kittyzhu)\
**Post date:** [November 24, 2021, 7:53am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/6 "2021-11-24T07:53:19Z")

</div>

Hi smeisler,  
I recently read a very related paper to your questions. The author did both steps as you mentioned. And they put their scripts openly access! You can have a look.  
[White matter tract signatures of fiber density and morphology in ADHD - ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0010945221000733?casa_token=D-oEduMtCMkAAAAA:yFHL5IO1_mUnzMvwXFXrikwkVbisN-CxKN37U2wVeO1CorOqU91ViCulAxeUqL2HP9tGno6d)

Kitty Zhu

---

<div class="post-metadata">

**Author:** ![kittyzhu](https://community.mrtrix.org/user_avatar/community.mrtrix.org/kittyzhu/32/3572_2.png) [@kittyzhu](https://community.mrtrix.org/u/kittyzhu)\
**Post date:** [November 24, 2021, 8:51am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/7 "2021-11-24T08:51:48Z")

</div>

I followed related thread and I think this one may answer your first question

> [@Calculating average FBA metrics of specific tracts](https://community.mrtrix.org/t/calculating-average-fba-metrics-of-specific-tracts/1805/7):
>
> Hi @anege, It’s entirely technically valid both to produce a fixel mask in subject space and compute mean FD within it, and to produce a fixel mask in template space and compute mean FD within it. The reason the latter is more conventionally employed is because the delineation of the pathway of interest in derivation of that mask only needs to be performed once, and can then be applied across all subjects. The former could be done if you could specify an automated & robust mechanism for consist…

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [December 4, 2021, 3:48am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/8 "2021-12-04T03:48:46Z")

</div>

> I see three potential ways to get a tract mask to use for FBA.

Three ways _utilising TractSeg_. There’s always the track editing approach: select (whether manual or automated) a subset of streamlines corresponding to the bundle of interest, and select the set of fixels traversed by those streamlines. This is still moderately common given it only needs to be done once for the whole study.

> Does this imply that option 3 (run TractSeg on the group-composite FOD image) is recommended?

The quoted text only says that that approach _can_ be used. If one of these options were to be preferable in terms of data quality, I would hypothesize option 1 based on the fact that TractSeg was trained on individual subject data; though it does complicate the process of accumulating data across subjects. In the absence of evidence of any detriment in doing so, I’d probably choose option 3 simply because it’s so much simpler computationally. But I wouldn’t put “recommended” into the authors’ mouths.

> Is this true even if only a subset of subjects are used to make the template?

As long as the template is adequately representative. If there were some consequence in using a subset of subjects only for forming the template in terms of applicability / performance of TractSeg, there would probably be consequences of such beyond TractSeg.

> The point I am still unsure of is the last sentence, where (at least in my case with a huge cohort) the masks wouldn’t come from all subjects.

Well, if you use option 3, the tract masks aren’t even “coming from a subset of subjects”: the template came from a subset of subjects, and tract masks are calculated on the resulting template agnostic to the subjects from which that template was generated. The fixel correspondence step in the FBA pipeline deals with establishing a common set of fixels across all subjects; all TractSeg would be doing is storing a 1 in some fixels and a 0 in others.

> 1. Changing step 12 …

> 1. Change step 21 …

While you _can_ do that, it makes everything downstream of such specific to your tract of interest. If you were to then want to look at some other tract in the same data, you’d have a lot of recalculation to do. Generally in this scenario I’d advise instead proceeding largely as per the whole-brain analysis pipeline, and changing just the final analysis. For instance, you could even still compute the fixel-fixel connectivity matrix and perform data smoothing using all fixels, and only at the very final `fixelcfestats` step do you constrain statistical inference to only your tract of interest.

Cheers  
Rob

---

<div class="post-metadata">

**Author:** ![yichao](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/y/9e8a1a/32.png) [@yichao](https://community.mrtrix.org/u/yichao)\
**Post date:** [December 8, 2021, 7:05am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/9 "2021-12-08T07:05:39Z")

</div>

![屏幕截图 2021-12-08 145713](https://community.mrtrix.org/uploads/default/original/2X/3/3e3bd07f5968c7059e5906f7c2c4403706d60d6d.png)  
hi,smeisler. I wonder how to run TractSeg in template space.I would be very grateful if you could teach me. As far as I am concerned, the file type of the the template space is the mif, however, the input of the TractSeg is the nii.gz

---

<div class="post-metadata">

**Author:** ![smeisler](https://community.mrtrix.org/user_avatar/community.mrtrix.org/smeisler/32/3620_2.png) [@smeisler](https://community.mrtrix.org/u/smeisler)\
**Post date:** [December 8, 2021, 12:45pm UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/10 "2021-12-08T12:45:25Z")

</div>

You can use `mrconvert` to convert your wmfod template mif to a .nii.gz. Then run `sh2peaks` on it. The resulting peaks file is your input to TractSeg.

---

<div class="post-metadata">

**Author:** ![yichao](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/y/9e8a1a/32.png) [@yichao](https://community.mrtrix.org/u/yichao)\
**Post date:** [December 9, 2021, 1:19am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/11 "2021-12-09T01:19:51Z")

</div>

Thank you very much. I run these commands. However,the voxel size of the peaks file is 1.8_1.8_1.8, the final track file is 1.79_1.73_1.73. Could you teach me how to solve it.  
TractSeg -i peaks.nii.gz --output\_type tract\_segmentation  
TractSeg -i peaks.nii.gz --output\_type endings\_segmentation  
TractSeg -i peaks.nii.gz --output\_type TOM  
Tracking -i peaks.nii.gz --tracking\_format tck

 ![屏幕截图 2021-12-09 090114](https://community.mrtrix.org/uploads/default/original/2X/d/d53b91dd271751c8bdb3ea2ff38d437643c005ac.png)  
 ![屏幕截图 2021-12-09 090210](https://community.mrtrix.org/uploads/default/original/2X/6/6d1a4b37c9cc779900c2162d6421bc6a34b20c40.png)  
 ![屏幕截图 2021-12-09 091932](https://community.mrtrix.org/uploads/default/original/2X/e/e5ae928bb20416edb29b298e0992af530a6e7040.png)

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [January 6, 2022, 1:47am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/12 "2022-01-06T01:47:27Z")

</div>

Hi @yichao,

The track file does not intrinsically possess a voxel size; streamlines are expressed as vertex locations in scanner space independently of any particular voxel grid. The entry in your first screenshot is merely sidecar information that has been written as text into the header of the queried track file. Where this information has come from is something specific to TractSeg, so I can’t provide any feedback personally.

Cheers  
Rob

---

<div class="post-metadata">

**Author:** ![yichao](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/y/9e8a1a/32.png) [@yichao](https://community.mrtrix.org/u/yichao)\
**Post date:** [January 6, 2022, 2:05am UTC](https://community.mrtrix.org/t/fixel-based-analyses-in-given-tract/5390/14 "2022-01-06T02:05:29Z")

</div>

I see. Thank you for help
