Thursday, February 27, 2014

Resting-State Functional Connectivity Analysis, Part II: Setting Up Your Analysis

Once you have downloaded the KKI dataset discussed in the last resting-state post, you have most of what you need, sacrificial undergraduate RA notwithstanding. Also, as I mentioned, we will be using AFNI for this, specifically AFNI's script which includes an option for preprocessing and analyzing resting-state data.

First, type from your terminal to open up the GUI (rhymes with "whey"), and select the resting-state option from the preprocessing selections. This will automatically fill in a series of preprocessing steps which our AFNI overlords, in their wisdom, have decided is best for resting-state analyses. Of course, you can change this, but that would be an unbelievably stupid decision, on par with doing something like asking out your girlfriend's sister.

Notice that with resting-state experiments, we avoid several of the annoying, persnickety details endemic to typical FMRI experiments, such as having to actually design an experiment. You simply place the subject inside the scanner, set the scanner to 350 degrees, and leave it for ten minutes. When you come back, you will have a slightly charred piece of carbon that used to be a human being. After framing someone else, such as your FMRI technician, you should then realize that you are simply not cut out for actually carrying out a resting-state scan, and download someone else's data instead from the Internet like I recommended in the first place.

Notice that much of the preprocessing and setting up the design matrix is the similar to usual FMRI analyses. However, there is an important difference in the design matrix setup, because you do not have any tasks or events to model. Instead, the only things you need to model are potential sources of noise, which may include heart rate or respiration data, if you have it, and always motion data, since this can be an insidious confound in any FMRI analysis, but particularly for resting-state analyses.

The upshot of all this is that, whereas in a traditional FMRI analysis AFNI saves the beta estimates and contrasts to a statistics dataset and everything else that wasn't modeled into an error or residual dataset (usually labelled "errts+orig"), in resting-state analyses we are interested in everything that wasn't explicitly modeled - in other words, we will want to focus on what gets output to the errts+orig dataset, since that will contain the timecourses of voxel activity that we are interested in. You can then place ROIs or other seed regions within that dataset, and generate correlation maps from those seed regions.

In the next chapter of the series, we will look more closely at converting these correlation values into z-maps for comparison across groups, as well as where to find more undergraduate RAs if the ones who were working in your lab have already been burnt as offerings to the FMRI gods.


  1. Hi Andrew,
    quick question: is there a similar way to do resting state analysis in fsl too?

    1. It involves a slightly different procedure (ICA), but yes, you can do it in FSL as well. I am planning on doing a set of tutorials to walk through that, although I can't say exactly when (probably sometime in the next few weeks).


    2. hey, thank you for the quick reply!
      your tutorials are quite helpful, so I will wait for it. In the meantime, I went through the FSL tutorial and found this one:
      I guess this might be useful.
      Since you are planning this video, I have a request =) could you please address breath and heartbeat removal, based on signals from ventricles and wm? I have just started with fmri and I am dealing with these problems, it would be great help.
      Sorry for all the mistakes, I am not a native English speaker =)

  2. Hi Andrew,
    Sorry this is an old thread but I was trying to use your tutorial today. When I try to run the script created in I get a "proc file not found" error:
    ** proc file not found: subject_results/group

    Am I missing something? Or should I have done some preprocessing steps prior to jumping into the Thanks for your help and other helpful tutorials!

    1. Hello,

      The directory structure and the processing script should be created automatically by the interface. I would double-check your permissions in that folder to create any new files or folders; that may be causing the issue.



    2. I had the same problem. It turns out that the scripts gets created but does not run. You need to manually run the scripts that is called proc.SubjectName. Then you will see the errts files. My problem is that I am not able to see these files when I want to have an overlay or when I am setting up the InstaCorr. Does anyone know why???

      Thank you

  3. This comment has been removed by the author.

  4. Hello Sir,

    I have used AFNI to calculate ALFF and FALFF from resting state data of schizophrenic patients. I got ALFF and FALFF results but i dont know how to intrepret the results. can you help me in interpreting ALFF and FALFF results.


    Nikhil Gupta