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?
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).
You would first need to convert your .tck files to fixels with tck2fixel (tck2fixel — MRtrix3 3.0 documentation). 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.
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.
# 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