Percentile thresholding option for 3dmerge or 3dclust

Hi AFNI Gurus!

I would like to make a resting state FC mask of the top 10% of correlations in a single subject using 3dClust or 3dMerge. In other words, I would like to use percentile thresholding instead of p-value thresholding. This can easily be visualized in the GUI by simply checking the “percentile threshold” box and placing the sliding threshold to 0.90. However, I am having trouble identifying how to do this with 3dClust or 3dMerge in the command line.

Is there an option or work around for this? Thanks!!

You can find the voxel value that corresponds to the top 10% with this:

3dBrickStat -percentile 90 1 90 mydset

Then use that voxel value as your threshold for the clustering.

Thank you! When I initially ran your command, the output was zero (ie 90.0 0.0). After reading a different thread I found that a solution to that problem is to add the -non-zero option. (ie 3dBrickStat -non-zero -percentile 90 1 90 mydset).

Lastly, on some datasets the threshold from 3dclusterize generated from the GUI save mask button is different or slightly off from the 3dBrickStat command. Is there an explanation for this?

There could be rounding issue or whether the threshold is inclusive or not. Try using a slightly higher or lower number to experiment.