# FBA measures for specific tracts per subject

**URL:** https://community.mrtrix.org/t/fba-measures-for-specific-tracts-per-subject/2500
**Category:** Uncategorized
**Created:** [May 3, 2019, 8:27am UTC](https://community.mrtrix.org/t/fba-measures-for-specific-tracts-per-subject/2500 "2019-05-03T08:27:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![phmag](https://community.mrtrix.org/user_avatar/community.mrtrix.org/phmag/32/177_2.png) [@phmag](https://community.mrtrix.org/u/phmag)
#### Post date: [May 3, 2019, 8:27am UTC](https://community.mrtrix.org/t/fba-measures-for-specific-tracts-per-subject/2500/1 "2019-05-03T08:27:36Z")

</div>

Hi all,

Apologies if the answer for this have been covered elsewhere but I’m going around in circles a little trying to come up with the right command/s to do this.

Using ROIs and tckedit I’ve delineated a number of specific streamlines (tcks) from the whole-brain tractography (generated via a study specific wmfod template and tckgen).

How to I go about creating a mask for each of these trk files so I can to calculate the mean value of FD within this mask for each subject via the mrstats command?

---

<div class="post-metadata">

### Author: ![phmag](https://community.mrtrix.org/user_avatar/community.mrtrix.org/phmag/32/177_2.png) [@phmag](https://community.mrtrix.org/u/phmag)
#### Post date: [May 6, 2019, 5:49am UTC](https://community.mrtrix.org/t/fba-measures-for-specific-tracts-per-subject/2500/2 "2019-05-06T05:49:22Z")

</div>

Ugh. I got it. Just for future reference for anyone…

tck2fixel will convert the tck to a fixel .mif image  
eg tck2fixel tract.tck fdc fdc tract.mif  
(two “fdc” are the folders containing the directions and index.mif’s the command requires. It can be any folder with these files in them

then

mrstats using this tract fixel image for the measure of interest.  
eg foreach \* : mrstats IN -output mean -mask tract.mif

---

<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: [May 28, 2019, 9:52am UTC](https://community.mrtrix.org/t/fba-measures-for-specific-tracts-per-subject/2500/3 "2019-05-28T09:52:01Z")

</div>

For clarity:

> ```auto
> tck2fixel tract.tck fdc fdc tract.mif
> mrstats IN -output mean -mask tract.mif
> 
> ```

There is an _implicit_ thresholding operation going on here, where any fixel with at least one streamline traversing it will be included in the mask. One could instead consider the more general case, where:

1. A fixel data file is generated by `tck2fixel` that contains the number of streamlines traversing each fixel;

2. “Some operation” is performed in order to produce from this a binary mask;

3. Statistics on some other fixel data file (e.g. FDC) may be computed from within this mask.

So it’s possible for there to be e.g. a thresholding operating where the threshold is not 1 streamline but something else.
