create statistical mask for functional data of faces > objects

Hi there,

After running proc_py on several subjects, I’d like to create statistical maps of face-selective voxels thresholded at a p-value of .001, but I’m not exactly sure how to do this.

In my case, I have 3 sub-bricks related to the face- selective voxels: sub-brick 19 is the coefficients, 20 is the tstats and 21 is the fstats.
I believe I need to use either 3dcalc or 3dmerge, but am having trouble figuring out the syntax.

Help is much appreciated!


You can use p2dsetstat to find out what the stat value corresponding to your p-value of interest is:
… something like the following in your case:

p2dsetstat  \
        -inset STAT_DSET'[20]'            \
        -pval 0.001                            \

(and you can also select the volume by the label, instead of its index, for greater understandability/stability of code.

Note that you should choose the sidedness of your testing appropriately (in moooost cases, 2-sided testing is the way to be):
“A tail of two sides: Artificially doubled false positive rates in neuroimaging due to the sidedness choice with t‐tests”

You can then use 3dcalc to make a mask, based on that; here, I have used tcsh syntax to combine with the previous calc, storing that result in a variable called “thresh” (the “-quiet” is necessary in the first case now, so that only a single number–the threshold–is output and saved in the variable):


set thresh = `p2dsetstat  \
        -inset STAT_DSET'[20]'            \
        -pval 0.001                            \
        -2sided                                \

3dcalc -a STAT_DSET'[20]' -expr "ispositive(a-${thresh})+isnegative(${thresh}-a)" -prefix masked_dset.nii

(first time through here, I forgot to get both the positive and negative sides in the expression… eek)

Although, can I ask why you are thresholding at the individual level? Normally, that is something done at the group level, combined with clusterizing or something (for which 3dClusterize will be your friend).

Also note some commentary on the importance of presenting more than just statistics in results reporting:
“Is the statistic value all we should care about in neuroimaging?”


Hi pt,

Thanks so much for this! I’ll try it all out, and hopefully it goes smoothly!

To answer your question about why we are thresholding at the individual level:
In general selection of the fusiform face area (FFA) is done in a subject specific manner, because the region can only be functionally defined and differs widely across subjects. So usually face selective voxels are selected for each subject, with various opinions on the optimal threshold, but p =.001 is the most stringent i believe. Then this map is combined with an anatomical mask of the fusiform gyrus. That is, if you want to define an ROI for FFA specifically, rather than voxels from other face-patches in the brain.

In studies like this, a second subject specific analysis comes next (with another proc_py script), where functional activity from a separate task is modeled. Then the activity from the second task can be extracted from the defined ROIs from earlier. Group analysis should come after that, I believe. (Granted this is all my first time doing this!)