Generate FA values of .tck file

Dear Experts:

I have generated a “DTI_30000.tck” file (The number of tracks is 30000). The command:
$ tckgen -algorithm SD_Stream DTI_fod.mif DTI_30000.tck -seed_image DTI_mask.nii -mask DTI_mask.nii -number 30000
Then, I want to generate a fa.mif file of the “DTI_30000.tck” file, so that each point of the trajectory corresponding to a FA value. Is there any method to reach the goal?
I am a beginner of MRtrix3, Thanks for your help!

Sincerely,
Chaoqing

Hey Chaoqing,

I’m not sure if this is the correct answer to your question, but I recently worked out how to create connectomes based off of FA values. The first step in deriving this may be what you’re looking for:

tcksample trackfile FAimg output

The corresponding webpage is here: http://mrtrix.readthedocs.io/en/latest/reference/commands/tcksample.html?highlight=tcksample

I also think this would be of use for you to read: http://mrtrix.readthedocs.io/en/latest/tutorials/FAQ.html#tck2connectome-no-longer-has-the-contrast-mean-scalar-option

Anyway, I’m no expert by any means, but I saw your question & thought these pages would be relevant to your question. Good luck!

Then, I want to generate a fa.mif file of the “DTI_30000.tck” file, so that each point of the trajectory corresponding to a FA value. Is there any method to reach the goal?

If what you’re looking for is the underlying FA value of each streamline point, then the resulting data will not be an image (and so would be best not to be referred to as “a fa.mif”). The tcksample command is indeed what you’re looking for. However, unlike the documentation page to which Amanda provided a link, you do not want to use the -stat_tck option. The purpose of this option is to compute some statistic from the values sampled along each streamline, such that only a single scalar value per streamline is produced. In your case, you explicitly want an FA value per streamline point, and hence you don’t want to use this option.

Cheers
Rob

1 Like

Hey,aszymanski,

It is really very nice of you to giving me the suggestion. I solved the issue according to your suggestion. It works very well.

Thank you very much!:grinning:

Sincerely,
Chaoqing

1 Like

Hey, Rob,

Thank you for your detailed reply. I’ve figured it out with your patient explanation. :wink:

Cheers,
Chaoqing

Dear Experts,

I’ve used following combined command (thanks @liyuan_yang for providing it here: The value of FA.nii.gz).

dwi2tensor dwi.mif - -mask mask.mif | tensor2metric - -fa fa.mif

to compute an FA mask, based on the preprocessed diffusion data (dwi.mif) and used it for subsequent command, to get info about the FA-values:

tcksample fiber_bundle.tck fa.mif values.tsf

Questions:

  1. I’d like to get info about the min and max FA values of the track.
    How could I calculate that? If I export the tcksample file via dwi2tensor without .tsf, I get a textfile showing all values. However, I don’t know how to find out the min and max values via computing (I could read through the whole document and mark the values by hand but that would take ages…)
  1. Is there an option to visualise the track file with the min and max FA values in the fashion of a heat map? So that the min FA values could be visualised dark and the max values bright?

Like always, thank you very much for your great support. Best, Lucius

ok, I found out nr.2:

tcksample fiber_bundle.tck fa_image.mif fa_values.tsf

as provided above already by @aszymanski (thanks)
and add the .tsf file as a color input, vgl. picture (green = tumour, bundle = sort of arcuate fascicle)

1 Like

I’d like to get info about the min and max FA values of the track.

This is where you should use the -stat_tck option within tcksample. That allows you to compute some statistic from the underlying values along each track, such as the minimum or maximum. The only reason for omitting the -stat_tck option is if it is necessary to retain all values along each streamline; for example, for the visualisation you have shown. You could theoretically compute these yourself from the output of tcksample, e.g. using a script to read the ASCII output and compute the min/max along each row, or implementing a hypothetical tsfstats command; but that would be wasteful given the functionality is already right there in tcksample.

Thank you very much for clarifying!