How can I get percentile values of a dataset?

Hi AFNI experts,
I’d like to know if there has any AFNI program could do something like “matlab prctile”, which returns percentiles of the values in a data vector or matrix X for the percentages p in the interval [0,100]. (http://www.mathworks.com/help/stats/prctile.html)
It would be very helpful if there has. Thanks a lot!

-Xiaodan

Hi, Xiaodan-

Sounds like you might want to use 3dBrickstat:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/programs/3dBrickStat_sphx.html#ahelp-3dbrickstat
with the following option:


-percentile p0 ps p1 write the percentile values starting
              at p0% and ending at p1% at a step of ps%
              Output is of the form p% value   p% value ...
              Percentile values are output first. 
              Only one sub-brick is accepted as input with this option.
              Write the author if you REALLY need this option
              to work with multiple sub-bricks.

and you can choose whether to use the non-zero specifier, as well, for example.

Note that you can search by description/category through all AFNI programs here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/educational/classified_progs.html

–pt