Combing ROIs: error with 3dcalc

Hi, List experts,

I had problems during the ROI combination, but I do not know how to understand the error alarms below. Is that I have problems with the ROIs themselves or anything else?

Thanks so much,
Juan

[S01@NY_Net] $ 3dcalc -a MPFC.nii -b VMPFC.nii -expr ‘(a+b)’ -prefix PFC.nii
++ 3dcalc: AFNI version=AFNI_16.3.13 (Nov 23 2016) [64-bit]
++ Authored by: A cast of thousands
** FATAL ERROR: dataset VMPFC.nii differs in size [153594 voxels] from others [902629]
** Program compile date = Nov 23 2016

[S01@NY_Net] $ 3dcalc -a L_VS.nii -b R_VS.nii -c rMPFC.nii -d rVMPFC.nii -expr ‘(a+b+c+d)’ -prefix 4ROI_Merged.nii
++ 3dcalc: AFNI version=AFNI_16.3.13 (Nov 23 2016) [64-bit]
++ Authored by: A cast of thousands
** ERROR (nifti_image_read): failed to find header file for ‘rMPFC.nii’
** FATAL ERROR: can’t open dataset rMPFC.nii
** Program compile date = Nov 23 2016

[S01@NY_Net] $ 3dcalc -a MPFC.nii -b VMPFC.nii -expr ‘(a+b)’ -prefix PFC.nii
++ 3dcalc: AFNI version=AFNI_16.3.13 (Nov 23 2016) [64-bit]
++ Authored by: A cast of thousands
** FATAL ERROR: dataset VMPFC.nii differs in size [153594 voxels] from others [902629]
** Program compile date = Nov 23 2016

It seems that I need first resize and make them same in the size…

That’s right. Glad you figured it out. Just in case, you may want to use this atlas for the Ventromedial prefrontal cortex, described here:

https://afni.nimh.nih.gov/afni/community/board/read.php?1,147025

Thanks so much, Daniel.But do you have any suggestion to use that VMPFC (In that post, you introduce the paper and we can download the mask, but it includes a lot of small masks of VMPFC). They are MNC formatted files, but AFNI can read it. Does it mean that if I want to only use the general VMPFC, I need first combine all of them? Thanks so much!!!

That atlas should be distributed by default with AFNI as the dataset, MNI_VmPFC+tlrc (.HEAD and .BRIK). Yes, you could combine all sub-regions together. depending on what you want to do. In 3dcalc, that would just be a single step operator in the expression for any non-zero, positive value in the atlas.

Also looking back at your 3dcalc expressions, you may want to consider either a ‘step(a+b+c+d)’ or ‘step(a)+2step(b)+4step(c)+8*step(d)’ as the expression. The first gives either a 0 or 1 at each voxel depending on whether any of the regions overlap that voxel. The second expression gives a binary-like code depending on which regions contribute to that voxel, and each resulting value comes from a unique combination of overlapping regions.