I am doing a seed based analysis on resting state data and instead or looking at correlations within the entire brain, we wanted to restrict the analysis to neocortex. I figured I would adjust my mask in 3dDeconvolve to analyze just neocortex (as indicated below ***) but in order to create that mask, I would have to add 100 or so ROIs. Is there a way that I could say, rather, (this atlas - regions (x+y+z)) rather than regions 1+2+3…100. Or even an easier way with 3dautomask or something?
this is the way I normally generate ROIs
3dcalc -a $atlas -expr “equals(a,34)+equals(a,33)” -prefix ${ROI}.nii
which makes everywhere in $atlas > 0 have a value of 1, and then subtracts 1 from regions #34 and #33, pushing those locations back to zero and hence out of the mask.
Or, if you wanted to maintain ROI numbering from the atlas, you could adjust the command to be:
3dcalc -a $atlas -expr "a*(step(a) - step(equals(a,34)+equals(a,33)))" -prefix NEW_MASK2
(and then you could reattach the labeltable).
–pt
ps: Only the first step() in each command should be needed, because the other #ed regions shouldn’t/can’t overlap, by definition, but I left it in in case other criteria came up.
Ok… thanks Paul. That’s exactly what I want to do, I just didn’t realize I could say step(a) to reference the entire $atlas… that is what it’s doing, correct? I am a little confused about the difference between example 1 and 2, however. The second example is keeping the ROIs information in the output mask?
Thanks Rick! So, in that example, each of those numbers would represent an annotated region in atlas (a) and be output in the FT_WM.nii file to represent “white matter”(WM), say?
Yes, the first example makes a binary mask (1s inside, 0s outside) where, say, regions [1…32] and [35…100] were, while the seond example makes a subset atlas containing just regions [1…32] and [35…100], each containing their original integer value.
If you have string labels associated with each integer (seeing a name when you click on a value in AFNI), then you would want to copy the labeltable from the initial atlas over to the newly created file.
–pt
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.