two-group, two-timepoint resting state fMRI analysis

Hello AFNI Users,

I have been running a resting state fMRI analysis in which two groups of participants were scanned prior to a few weeks of brain stimulation (or sham), and and scanned again afterwards. The goal is to examine any potential changes in functional connectivity using the stimulation site as the seed area (which in this case is the SMA). Also, I should note that the groups are unbalanced (one has 9 participants, the other has 6 participants).

The steps I have taken so far include:

  1. to preprocess the resting state data for each of the participants,
  2. whereami to make a mask of the SMA
  3. 3dresample to match the grid spacing in the mask to the processed rsfMRI data (errts)
  4. 3dROIstats to extract the SMA time series from each participant
  5. 3dTcorr1D to generate correlations between the SMA time series and the rest of the brain
  6. 3dcalc to convert to r scores to z scores

I hope this workflow is correct. If so, I was wondering if 3dANOVA3 -type 5 is the correct way to set up a 2 group, 2 time point analysis? Also, I was planning to correlate behavioural change scores with the imaging results so any advice on how to set that up would also be appreciated.

Thank you for any guidance you can offer, and please let me know if more information would be helpful.



That seems fine to me. I would just note that Steps 4-6 coudl all be done within 3dNetCorr with various options:

# calc+save average time series of each ROI
    -ts_out          :switch to output the mean time series of the ROIs that
                      have been used to generate the correlation matrices.
                      Output filenames mirror those of the correlation
                      matrix files, with a '.netts' postfix.
    -ts_indiv        :switch to create a directory for each network that
                      contains the average time series for each ROI in
                      individual files (each file has one line).
                      The directories are labelled PREFIX_000_INDIV/,
                      PREFIX_001_INDIV/, etc. (one per network). Within each
                      directory, the files are labelled ROI_001.netts,
                      ROI_002.netts, etc., with the numbers given by the
                      actual ROI integer labels.

# get whole brain correlation map of each average ROI time series,
# as either Pearson corr or Fisher-transformed Z-score (second opt)
    -ts_wb_corr      :switch to perform whole brain correlation for each
                      ROI's average time series; this will automatically
                      create a directory for each network that contains the
                      set of whole brain correlation maps (Pearson 'r's).
                      The directories are labelled as above for '-ts_indiv'
                      Within each directory, the files are labelled
                      WB_CORR_ROI_001+orig, WB_CORR_ROI_002+orig, etc., with
                      the numbers given by the actual ROI integer labels.
    -ts_wb_Z         :same as above in '-ts_wb_corr', except that the maps
                      have been Fisher transformed to Z-scores the relation:
                      To avoid infinities in the transform, Pearson values 
                      are effectively capped at |r| = 0.999329 (where
                      |Z| = 4.0;  hope that's good enough).
                      Files are labelled WB_Z_ROI_001+orig, etc.

The benefit of 3dNetCorr would be you could also investigate multiple ROIs simultaneously, as well as their correlation.


Hi Paul (not Paul, but Paul),

Alternatively, one can use 3dGroupInCorr to run a full brain correlation analysis (not ROI-based), given possibly multiple seed locations and/or ROIs. There is an (11 year old) example with sample scripts at AFNI_Demo_Motion_Groups/scripts. That can be installed and run by running @Install_RSFMRI_Motion_Group_Demo, but it is a 6.6 GB package which would run the preprocessing on all. It's big. But given that you have already run the preprocessing, the s[23456]* scripts might be helpful.

It should amount to the same as what you are doing, but might be easier to extend to other cases.

  • rick