Calculating the tract volume

Hi MRtrix expert,

I am trying to calculate the volume of a tract (IFOF) in two different groups. I have generated the whole-brain tractography and extracted the IFOF tract. FA, length and streamline count are calculated.

Regards,
Salah

1 Like

Welcome Salah!

The typical approach to calculating a tract volume is to:

  1. Generate a binary mask corresponding to the tract;
  2. Calculate the number of voxels contained within that mask;
  3. Multiply this number by the volume of each voxel.

Step 1 would typically be achieved using a combination of tckmap (to get a streamline count per voxel) and mrthreshold to go from a streamline count per voxel to a binary mask. Step 2 can be obtained by running mrstats with the -mask option, and extracting the value of “count”. For Step 3 you can get the voxel spacing in mm from mrinfo.

The specific details of Step 1 are not entirely unambiguous though, there’s a few different ways it could be done, or little tweaks that could be applied. There’s a little bit of discussion around it in this paper from @Lee_Reid; I’m not aware of any other manuscripts that discuss specifically the nuances of tract volume quantification, but others are free to provide links.

Cheers
Rob

1 Like

Hi Rob

Thank you for your reply. I tired to open the paper you have attached but for some reason I wont open. Anyhow, I calculated the volume using this steps:
1- use tckmap to create tract-weighted FA in nii format
(tckmap -mage DIR/fa.mif -template DIR/fa.mif TRACT.tck DIR/twfa.nii
2 - fslmaths to create binary image bin.nii with a threshold 10
(fslmaths DIR/twfa.nii -thr 10 -bin DIR/bin.nii
3 - fslstats to calculate the tract volume with -V
(fslstats DIR/bin.nii -v)

The middle value is the volume of the tract.

Regards,
Salah

1 Like

I tried to open the paper you have attached but for some reason it wont open.

Sorry, I copy & pasted the wrong text into the hyperlink; fixed.

Anyhow, I calculated the volume using this steps:

You can also use MRtrix3’s mrthreshold to produce a binary mask image, and mrstats -mask -output count to query the number of voxels in the mask (then multiply by the voxel volume to get tract volume in mm).

1 Like

Dear all,

I followed the steps you mentioned for a few healthy subjects, I found the same value of the volume ‘count’ ,really no difference, the results seem a little strange to me, I didn’t understand where the problem is?
Could you explain the thresholding command to me a bit;
I thought the stuff is in the thresholding step,

I will appreciate any help,
Best,
Abir.

Hi Abir

For me, I did not use ‘mrthreshold’ and ‘mrstats’. I used instead the fslmaths and fslstats.

Sorry Abir. Perhaps @rsmith could answer it as he is expert.

Salah

Hi Abir,

Given that you are reporting that you are getting the same value in mrstats's “count” output across multiple subjects, then my best guess is that you are merely providing the mask images to mrstats without using the -mask option. In that instance, what mrstats is telling you is the total number of voxels in the image FoV; not the number of voxels that contain a non-zero value. Passing the same image to mrstats via the -mask option will compute summary statistics within only those voxels present in the mask. Alternatively you could use the -ignorezero option, which will have a similar effect of excluding voxels absent from the binary mask image from the statistics calculation.

Rob

2 Likes

Can this be applied to a mask ROI multiplied by an FA image (no tracts generated)?
So

  1. mrthreshold binary mask ROI registered to native FA.mif space.
  2. mrstats -mask to calculate a count value within ROI mask within FA image.
  3. mrinfo reveals the voxel size is 2x2x2. So multiply count output by 2? or by 8?

Is this appropriate?

Can this be applied to a mask ROI multiplied by an FA image (no tracts generated)?

I’m having trouble determining for sure the nature of the misunderstanding here.

  • If you explicitly multiply a binary ROI image with an FA image, you get a masked FA image.
  • If you run mrstats on your FA image, providing a binary mask image via the -mask option, then the output of the count field will be the number of voxels in the mask image that contributed to the calculation of the other statistics; it will not be influenced in any way by the contents of the FA image.
  • If you were to e.g. take the mean FA value within that mask, and multiply this by the volume of the tract, the resulting value would be … the product of the mean FA and the tract volume. I don’t see any merit to such, even if it “can” be done.

2… mrstats -mask to calculate a count value within ROI mask within FA image.

The word “within” is being used twice to refer to two different things, which makes this hard to interpret.

  1. mrinfo reveals the voxel size is 2x2x2. So multiply count output by 2? or by 8?

Volume of a cuboid is the product of the lengths of all three sides; so 8.