Extracting beta values from specific brain area

Dear AFNI experts,

I am looking for some advice to extracting beta values from specific brain area.
There are two questions, one is generating a mask, and the other one is extracting the beta values
(I’m new to this part, so forgive me if my question is too basic…)

Steps which I did:

  1. Extract cluster, where I am interest in, from ANOVA result:
    3dclust -1noneg -1thresh 0.05 -prefix anova_cluster 3 500 ANOVA’[5]’

  2. Create a mask1:
    whereami -mask_atlas_region CA_ML_18_MNIA:R:ins
    (I used CA_ML_18_MNIA because I normalized the data into MNI space)

  3. Resample the mask:
    3dresample -dxyz 3.0 3.0 3.0 -prefix resample3 -input CA_ML_18_MNIA.ins.r+tlrc

  4. Create a mask2:
    3dcalc -prefix ROI -a ‘resample3+tlrc’ -b ‘anova_cluster+tlrc’ -expr ‘(step(a)*b)’

When I process no.4, I got the FATAL ERROR message “dataset anova_cluster+tlrc differs in size [~voxels] from others [~]”
I’m not clear what I have to check… even I tried to search other materials.
(- As I understood, I thought when we generate a mask, the values of the regions where we interested in are ‘1’, and the other parts are ‘0’.
Thus, I thought the voxel size should be same…)
Therefore, in this part, may I ask you that how can I solve the problem?

i. Create a mask from specific area (because I failed on generating the mask using two data…[above one…])
whereami -mask_atlas_region CA_ML_18_MNIA:R:ins

ii. Resample the mask:
3dresample -dxyz 3.0 3.0 3.0 -prefix resample3 -input CA_ML_18_MNIA.ins.r+tlrc

iii. Tried to extract beta values [actually… I’m not sure that this function is correct…]
3dmaskave -mask resample3+tlrc stats.s10_REML+tlrc’[4]’

When I process no.iii, I also get the message that the “Input and mask datasets are not same dimensions!”
Also, I’m not clear whether it is right way to extract the beta values
Thus, may I ask you that how can I solve this problem? (also extracting the beta values)

Thank you in advance.

The 3dcalc error has to do with both the grid and voxel size of the input datasets. Instead of just resizing the voxels to 3mm3, resample the atlas mask dataset to the grid of your cluster results dataset. If the region is thinner, consider using 3dfractionize instead to take advantage of more liberally using the fractional parts of regions.

3dresample -master anova_cluster+tlrc -prefix resample3 -input CA_ML_18_MNIA.ins.r+tlrc
3dcalc -prefix ROI -a ‘resample3+tlrc’ -b ‘anova_cluster+tlrc’ -expr ‘(step(a)*b)’

Your second question is really the same as the first. Again the mask must match the dimensions of the dataset you want to get the average of. Use the identical approach with 3dresample or 3dfractionize to compute the regridded region.

Thank you so much for your help!! :slight_smile:

Thank you