# Extracting only tracts from significant fixels?

**URL:** <https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496>\
**Category:** Uncategorized\
**Created:** [August 21, 2025, 8:22pm UTC](https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496 "2025-08-21T20:22:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Campbell](https://community.mrtrix.org/user_avatar/community.mrtrix.org/ivan_campbell/32/4449_2.png) [@Ivan\_Campbell](https://community.mrtrix.org/u/Ivan_Campbell)\
**Post date:** [August 21, 2025, 8:22pm UTC](https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496/1 "2025-08-21T20:22:30Z")

</div>

I’ve recently completed an FDC stats analysis and I’m trying to find a way to automatically identify the significant tracts. I’m unaware of any way to do this natively in MRtrix (please correct me if there is), so I’m hoping to create a tract file of only the significant fixels from that analysis to use in DSIStudio to recognize the tracts. I’ve tried a few different things such as masking the tract file but it hasn’t worked. I just need the tracts that are specifically in the significant fixel regions. How can I accomplish this?

---

<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:** [August 28, 2025, 5:25pm UTC](https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496/2 "2025-08-28T17:25:51Z")

</div>

Hi @Ivan_Campbell I do something similar in code used for my paper ([Fiber-specific structural properties relate to reading skills in children and adolescents | eLife](https://elifesciences.org/articles/82088)).

You would first need to convert your .tck files to fixels with `tck2fixel` ([tck2fixel — MRtrix3 3.0 documentation](https://mrtrix.readthedocs.io/en/dev/reference/commands/tck2fixel.html)). For example, my command is below, but of course you would need to alter for your paths. Also note that my tractography was in template, not native space, based on the FOD template generated as part of the FBA.

```auto
for tck in $ts_out/TOM_trackings/*.tck # This is where my TractSeg tcks are
	do tract=$(basename "$tck" .tck)
	$mrtrix tck2fixel $tck $fixel_dir/template/fixel_mask $tractseg_out/tck_fixels $tract.mif
done

echo 'BINARIZING TRACT FIXEL MASKS'
for tract in $tractseg_out/tck_fixels/*.mif
	do $mrtrix mrthreshold $tract ${tract//.mif}_bin.mif -abs 1 -force
done

```

Then it is as simple as intersecting these tract fixel masks with fixel-wise maps of your FDR p-values.

```bash
# Loop over tract masks
for track in $outdir/template/tractseg/tck_fixels/*bin*; # The binary tract fixel masks from the last step
	# Calculate proportion of tract occupied by significant fixels
	do proportion=$($mrtrix mrstats $outdir/template/modelarray_outputs/mifs_${metric}_${subtest}${suffix}/sig_fixels.mif -mask $track -output mean); 
	# Get number of significant fixels per tract
	count_tract=$($mrtrix mrstats $outdir/template/modelarray_outputs/mifs_${metric}_${subtest}${suffix}/sig_fixels.mif -mask $track -output count);
	# Get number of total fixels per tract
	num_fixels=$(echo "$proportion * $count_tract" | bc);
	# Get max effect size achieved in tract
	max_eff_tract=$($mrtrix mrstats $outdir/template/modelarray_outputs/mifs_${metric}_${subtest}${suffix}/result_gam_${subtest}_DM.delta.adj.rsq.mif -mask $track -output max);
	# Add information to text file
	echo $(basename $track) >> $out_file;
	printf "%.0f\n" $num_fixels >> $out_file;
	echo $proportion >> $out_file;
	echo $max_eff_tract >> $out_file;
done

```

Note that I used modelarray to run my FBA statistics. But you can run the `mrstats` on any of your fixel outputs.

Best,  
Steven

---

<div class="post-metadata">

**Author:** ![iqraalimirza16](https://community.mrtrix.org/user_avatar/community.mrtrix.org/iqraalimirza16/32/5447_2.png) [@iqraalimirza16](https://community.mrtrix.org/u/iqraalimirza16)\
**Post date:** [April 22, 2026, 8:31am UTC](https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496/3 "2026-04-22T08:31:43Z")

</div>

Hello! thank you very much for sharing your paper, as well as the code in detail. I am trying to run a whole brain FBA for my thesis as well, and I want to extract tracts from significant fixels too. I wanted to ask, through TractSeg is there a way you may know through which I could limit the number of tracts and filter some of them out? because 72 tracts is a lot, I have been unable to find more information on how I may be able to do so.

---

<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:** [April 22, 2026, 12:28pm UTC](https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496/4 "2026-04-22T12:28:51Z")

</div>

Yes, they show an example in the TractSeg documentation:

```auto
Tracking -i peaks.nii.gz --bundles CST_right,CA,IFO_right

```

---

<div class="post-metadata">

**Author:** ![iqraalimirza16](https://community.mrtrix.org/user_avatar/community.mrtrix.org/iqraalimirza16/32/5447_2.png) [@iqraalimirza16](https://community.mrtrix.org/u/iqraalimirza16)\
**Post date:** [April 22, 2026, 1:04pm UTC](https://community.mrtrix.org/t/extracting-only-tracts-from-significant-fixels/8496/5 "2026-04-22T13:04:26Z")

</div>

Thank you so much!
