3dcalc / 3dABoverlap question


I am examining seed based functional connectivity for a group of participants across two separate scan sessions. My goal is to use 3dABoverlap to compute % positive correlation voxels that are common across both scans.

I used 3dcalc to create a mask of positive correlation voxels with the seed location, thresholded at p < 0.005 uncorrected using:
3dcalc -a input_file -prefix output_file -expr ‘ispositive(a-0.2044)’

However, I would like to refine each of the masks further by only retaining voxels in the masks that are contained within a pre-specified cluster size. For example, I only want to mask voxels that have a positive correlation with the seed at p. 005 AND are part of a larger cluster of size NN3 and 40 voxels.

Is there any coding function to do this? Or would I have to open up each mask individually, set the new cluster size, and then save the surviving voxels as a new mask?


Hi, Jesse-

3dClusterize is what you want, maybe with p2dsetstat, but you can use the p-value to specify the threshold.

Some examples: