Creating ROI masks from the output of fixelcfestats?

Hello experts, I am trying to figure out the best way to extract mean fc, fd, and fdc from a pvalue-based ROI, across each subject in my study. For example, say I wanted to plot the association between Age and mean fdc in voxels that differ significantly between groups. Basically, what I want to do is:

  1. Figure out the best way to threshold/convert the outputprefix_fwe_pvalue.msf file as a mask containing p values greater than .95 (inverse of .05)
  2. extract the mean fdc across this ROI for each subject’s (converted?) fdc.msf image, and store/print it somewhere for external analyses

Thanks for your time,
Rachael

1 Like

Hi Rachael,
We are working on a large update to be released soon. It will include additional features to do what you want.

I started writing a reply with instructions on how you can get access to the new tools sooner (it’s in the fixel_format branch on Github) and what commands you need to run to do what you want. However it was getting quite lengthy and I didn’t get time to finish it today. I’ll finish it off first thing in the morning.
Cheers,
Dave

2 Likes

I appreciate your taking the time to leave a note! Sounds like the next update is going to be really exciting.

Hi Rachael,
Sorry it just occurred to me you can do what you want with the existing fixelthreshold and fixelstats commands.

To compute a fixel mask of p < 0.05:

fixelthreshold fwe_pvalue.msf 0.05 significance_mask.msf

Then to estimate the mean value inside this mask:

fixelstats subject1_fdc.msf  -mask significance_mask.msf -output mean

Sorry about the delay in getting back to you. I completely forgot I had implemented fixelstats. I have been working on a different branch of MRtrix for a while now that does not have it. In the upcoming release the commands for working on fixel files are somewhat different (and more flexible), however for your existing study that has *.msf files this will do what you need.
Cheers,
Dave

Thanks! Just to be clear, does fixelthreshold want the regular p-value or the inverse pvalue? Based on the documentation, I thought it would be:

fixelthreshold fwe_pvalue.msf 0.95 significance_mask.msf

Ah yes. Sorry, my mistake.

Hi Dave,

It looks like both fixelthreshold and fixelstats are deprecated in the latest updates–I can’t seem to accomplish this same task (making a mask based on significant fixels) using mrthreshold. Any suggestions?

Cheers,
Rachael

Rachael,

Many fixel* commands are deprecated with the new fixel format. This is because each fixel data file is simply an image file (albeit a one-dimensional “image”), and therefore many of the MRtrix3 commands “intended” for working with image data (e.g. mrthreshold, mrstats) work seamlessly with fixel data files. This saves us the effort of duplicating & managing the same functionality across multiple commands just because they operate on different data.

Using mrthreshold directly on the FWE p-value image / file should achieve the same purpose. I suspect your error is that it looks as though from your previous usage:

fixelthreshold fwe_pvalue.msf 0.95 significance_mask.msf

, fixelthreshold took the threshold value as a compulsory command-line argument. mrthreshold simply takes the input and output “images” as the compulsory command-line arguments, and automatically calculates an appropriate threshold (which won’t work for fixel data files); so most likely you want to use the -abs option to manually specify the absolute threshold value. Therefore your usage would be:

mrthreshold fwe_pvalue.mif significance_mask.mif -abs 0.95

Rob