Robert J. and Nancy D. Carney Institute for Brain Science

Multi-Voxel Pattern Analysis (MVPA)

This example provides one method of performing MVPA using AFNI. It is meant to be a relatively straightforward example for beginners wanting to learn the basics of MVPA. We would like to emphasize that there are many ways of performing MVPA that may be better suited to the design of your study. Be sure to take a look at the links in the Additional Resources section at the bottom of this page for more information.

Prior to beginning this analysis, you will need to install AFNI on your computer. The AFNI download help page will assist you in downloading this program.

Download AFNI

If you are unfamiliar with UNIX or shell scripting, visit AFNI's Unix Tutorial before beginning this analysis.

The commands in this tutorial are meant to be used in a bash shell, so you may need to update your .bashrc file with the AFNI path if you only have AFNI configured for tcsh. See Step 3 on the help page for more information.

We also assume that you have a general knowledge of imaging analysis, so we do not cover pre-processing, stimulus timing file creation, or ROI mask generation in detail.

To follow along with our analysis steps, download the example dataset. This folder includes the following:

  • raw data for the 8 runs (run#.nii)
  • pre-processed data for the 8 runs (run#.preproc.nii)
  • stimulus timing files (stimuli.block.onsets.1D)
  • ROI mask (final.mask.nii)
  • training dataset labels (trainLabels.1D)

Note that this example is for a single subject only, so we will provide you with specific commands to run rather than a script for processing multiple subjects. It would be helpful to create your own script using these commands for use with multiple subjects.

If you encounter any issues along the way, the AFNI help forum is a great place to search for solutions to your errors.