Make use of atlas ROIs as mask for other programs


I am trying to describe the results of a parametric map in my group analyses. To check which anatomical areas show supra-threshold voxels I simply used the clusterize+whereami option in the GUI, and that went perfect. But now I want to check local maximas within some given anatomical ROIs (from atlases). I know you can use 3dExtrema with a mask for that, but I was having some issues with it. When I try to provide an atlas region as mask, for instance:

    3dExtrema -prefix clustersROIs/sem/l_sma               \
        -mask_file MNI_caez_ml_18+tlrc.'<Left_SMA>'    \
        -mask_thr 1                                    \
        -data_thr 0.014                                \
        -maxima -strict -slice -interior               \
        -sep_dist 10.0 -average                        \
        avg_sem+tlrc. > clustersROIs/sem/l_sma.txt

it can't open the mask dataset. I'm assuming I am not calling it properly, but I wondered if this is even possible (I mean using JUST the region in the atlas as mask, without masking it to a different file first).

*Note. I made sure that the atlas is in the proper directory (I copied it from abin for ease of use).

When I do, for instance,

afni MNI_caez_ml_18+tlrc.'<Left_SMA>'

It prompts me with the error "cannot open Left_SMA: No such file"

But funnily enough, it perfectly opens it and shows just the Left SMA area as in the AAL atlas :sweat_smile:

Is there a way to use atlas regions dynamically (directly indexing them from the atlas) as masks for other programs (like 3dExtrema) without having to mask each area to a new file, and then use it as mask??


You can use atlas regions dynamically on the command line, but the syntax is a little different. Using atlases by their dataset file name, requires a path to the file, so this should work (putting the path you use):

3dBrickStat -count -non-zero ~/abin/MNI_caez_ml_18+tlrc.'<Left_SMA>'