Quickly Creating Masks in AFNI

Often when creating a mask to use with 3dROIstats, 3dmaskave, or 3dmaskdump, we will create a mask at a higher resolution than our functional runs, detailed here.  One of the reasons the mask is created at a higher resolution is that we base the anatomical masks on either 1) the high-resolution anatomical or 2) the high-resolution Atlas, which may be 1x1x1mm, while our functional data may be 3x3x3mm.  In order to reduce the grid size to match the functional data we use either 3dresample or 3dfractionize.  3dfractionize has the benefit of setting a clip level or being able to warp the mask from one space to another (tlrc –> orig / orig–>tlrc). But it turns out that you don’t necessarily need to make creating masks a two step process, particularly if you are basing the mask on an Atlas!  For example:

3dresample -master Subject1+tlrc. \
-inset CA_N27_ML:left:middle_frontal_gyrus \
-prefix L_MFG

Here I’ve used 3dresample to create a mask of the Left IFG based on the Colin27 Macro Label Atlas.  In this one step I have also supplied 3dresample with a single subject in my dataset with the correct grid size and space (Subject1+tlrc) to resample the Atlas ROI to the correct space. For more information on masking in AFNI, checkout these posts (here and here).

Comments are closed.