grid mismatch error extracting time series

Hello,

I am trying to extract time series and am using the command below:
3dmaskave -q -mask /Volumes/masks/SN_resam.nii.gz
func_task_pp_ICAaroma_bptf.nii.gz \

/Volumes/subjects/${subj}/${subj}_SN.1D

However, am getting the error:
Input dataset func_task_pp_ICAaroma_bptf.nii.gz grid mismatch from mask.
*** Input and mask datasets are not same dimensions!

I’ve tried the following:
3dinfo -header_line -prefix -same_all_grid /Volumes/masks/SN_resam.nii.gz /Volumes/K99_Data/${subj}/restingHCP/func_task_pp_ICAaroma_bptf.nii.gz
3dmaskave -q -mask /Volumes/masks/SN_resam.nii.gz
func_task_pp_ICAaroma_bptf.nii.gz \

/Volumes/subjects/${subj}/${subj}_SN.1D

And received the following message:
prefix =dim? =delt? =ornt? =cent? =obl?
SN_resam.nii.gz 0 1 1 0 1
func_task_pp_ICAaroma_bptf.nii.gz 0 1 1 0 1
++ 3dmaskave: AFNI version=AFNI_21.3.17 (Dec 30 2021) [64-bit]
*+ WARNING: Input dataset func_task_pp_ICAaroma_bptf.nii.gz grid mismatch from mask.
Try the following command for grid comparison:
3dinfo -header_line -prefix -same_all_grid /Volumes/masks/SN_resam.nii.gz /Volumes/K99_Data/${subj}/restingHCP/func_task_pp_ICAaroma_bptf.nii.gz
*** Input and mask datasets are not same dimensions!
logout

Can you please advise?? Thank you so much!

You need to resample the mask so that it is on the gridset as the functional data.

3dresample is one program that can do this for you.


3dresample -master func_task_pp_ICAaroma_bptf.nii.gz -prefix SN_resam.nii -input SN.nii

here the -master dataset is the one you want to match.

3dfractionze can also do this and will give you much more control over process.