Sampling MD and FA values along streamlines

Hi MRtrix experts,

As a relatively new user of MRtrix I’m currently trying to sample MD and FA values from a tck file, but I’m not sure about how to do this correctly. For sampling FA values I used the following commands:

     dwi2tensor dwi_preproc.mif tensor.mif
     tensor2metric tensor.mif -fa fa.mif
     tcksample -stat_tck mean trackfile.tck fa.mif output.file

Then, I calculated the mean of the output values in Excel. From what I’ve seen in other topics, I am pretty confident that this is the right way to go. However, I doubt whether this approach is also the way to go for sampling MD values. I did not come across many examples in other topics. If it is the right way to go, would it look like this?

tensor2metric tensor.mif -adc adc.mif
tcksample -stat_tck mean trackfile.tck adc.mif output.file

Is using the -stat_tck mean option the right way to go for sampling MD values? It feels a bit odd to use a mean option on a mean parameter…

Any suggestions are welcome and thanks a lot in advance!

Best, Rianne

1 Like

no problem with your approach. the “mean” in “mean diffusivity” is computed at the local tensor level (at each voxel of your DWI volume). It’s (related to) the trace of the matrix describing the tensor (see here) - averaging along a tract is perfectly valid.

Perfect! Thanks a lot!

It feels a bit odd to use a mean option on a mean parameter…

That’s possibly because many people fail to articulate that that’s actually what’s going on…

The alternative way of doing this is to generate a binary mask based on the streamlines in the .tck file (e.g. using tckmap | mrthreshold), and then take the mean of the quantitative parameter within that mask. In that case there’s only one “mean” calculation, not two, which may contribute to the sense of peculiarity.

Hi,as a relatively new user of MRtrix ,can you show me the detailed code?
Thank you