ROI analysis with 3dTcorrMap

Hi, AFNI experts,

I want to use a ROI as seed to correlate with all other voxels. Now I have got a ROI mask, but how can I use this ROI mask to create a seed dataset?

Thanks all

How about 3dmaskave?

3dmaskave -mask yourROImask yourData > seed.1D

But seed data needs 3D+time dataset. 1D file can’t use as a seed data.

But seed data needs 3D+time dataset. 1D file can’t use as a seed data.

I’m not so sure exactly what you’re trying to compute. The correlation between seed region and the whole brain, or the correlation within the seed region, or something else?

Hello, I’m also trying to solve the same problem.

I want to compute the correlation between the seed region (ROI) and the rest of the brain. I’ll start with how I created my ROI.

First I created a mask of the left precuneus using the TT_Daemon atlas. Then I warped it to MNI space using 3dWarp.


whereami -mask_atlas_Region TT_Daemon:left:precuneus -prefix Lprec
3dWarp -prefix L_precunn -tta2mni Lprec+tlrc

Since I have received an error on input dataset grid mismatch, I re-sampled the mask to the fanaticor dataset before using maskave.


3dresample -master errts.subj.fanaticor+tlrc. -inset Lprecuneus+tlrc -prefix L_precuneusM
3dmaskave -mask L_precuneusM+tlrc -quiet errts.subj.fanaticor+tlrc. > L_precun.1D

Now I wanted to correlate this ROI to the rest of the brain using 3dTcorrMap, but received the following output:


3dTcorrMap -input errts.subj.fanaticor+tlrc. -bpass 0.01 0.1 -Gblur 4 -seed L_precun.1D -mask mask_epi_anat.subj+tlrc. -Mean Lpre_Mean
++ 3dTcorrMap: AFNI version=AFNI_19.2.01 (Jul  3 2019) [64-bit]
++ Number of voxels in mask = 107829
 + bandpass: ntime=198 nFFT=198 dt=3 dFreq=0.0016835 Nyquist=0.166667 passband indexes=6..59
** FATAL ERROR: -seed dataset time series length 1 doesn't match -input 198
** Program compile date = Jul  3 2019

I know there are 198 time series in my .1D file, so I’ve transposed the .1D dataset (using 1dtranspose) and tried it again, but then I got:


** FATAL ERROR: -seed dataset doesn't match -input dataset in space

Any suggestions from here?

Thank you.

3dTcorrMap is not what you want. Instead, use either of the three programs (3dTcorr1D, 3dDeconvolve and 3dfim+) for seed-based correlation analysis.

I’ve tried 3dTcorr1D (and 3dfim+) and it looks like it works, but I’m not sure if what I am doing is correct. Below is my script so far:


whereami -mask_atlas_Region TT_Daemon:left:precuneus -prefix Lprec
3dWarp -prefix L_precunn -tta2mni Lprec+tlrc
3dresample -master errts.subj.fanaticor+tlrc. -inset Lprecunn+tlrc -prefix L_precuneusM
3dmaskave -mask L_precuneusM+tlrc -quiet errts.subj.fanaticor+tlrc. > L_precun.1D
1dBandpass 0.01 0.1 L_precun.1D > L_precunn.1D
3dTcorr1D -prefix Left_precuneusCorr -mask mask_brain+tlrc. errts.subj.fanaticor+tlrc. L_precunn.1D

I know that by default, 3dTcorr1D uses pearson correlation coefficient. The highest overlay threshold value is 0.56, but shouldn’t the correlation with itself be one of the highest, at least 0.8?

Edit: I think I figured out the problems in my script. Thank you.