Monday, November 12, 2012

Introduction to SPM Marsbar

Marsbar is an extraction tool designed to output beta estimates or contrast estimates from a region of interest (ROI), a cluster of voxels defined either anatomically, or through an independent contrast. I covered this in an earlier post, but thought that this would lend itself better to a bright, vibrant, visual tutorial, rather than the musty arrow charts.

How to define ROIs from coordinates

How to define ROIs from other contrasts


  1. Hi Andrew!

    Thank you very much for your really comprehensive teaching!

    I have a problem during watching the videos. How can we extract several ROI time series signals at the same time? Since it seems we can just extract one ROI at the same time. Or we can use ROI1&ROI2 such symbols to extract them? If we want to use these extracted signals later in SPM, what should the outputs be? The image or the mask?

    Thank you again!


    1. Hey Tracy,

      Thanks for the kind words! I'm not using Marsbar that much anymore, but I don't think you can extract data from multiple ROIs simultaneously using it. However, you can extract from multiple ROIs simultaneously with AFNI's 3dROIstats (see the documentation on the AFNI website and also a blog post here:

      As for the output, you should get a timeseries out of each of them, which you can them combine into a variable called R, and use that for multiple regression through SPM's GUI (if you're trying to account for different sources of variance from those ROIs, e.g., the average timecourse from white matter and CSF if you're treating them as nuisance variables).

      But check this out: If you're using SPM12, you can load up the results, threshold however you want, and then right click on the MIP (the glass brain window) and select whether you want to extract the whitened and filtered "y" from the cluster or the voxel at the center of the crosshairs. This will create a variable called y, which is the timecourse from that voxel or cluster. Very nice for extracting timecourses from ROIs for single subjects.



    2. Hi Andy,

      Thanks for your really prompt and detailed reply. These days I just try to extract the time series signals using both SPM and AFNI. I listen to your suggestion and start to use AFNI to extract the ROI signals. It is really faster than SPM, where I can just get ROI one by one. However, I come across a problem that I quite don't understand.I calculate the pearson correlations between those ROI signals. But the correlation of signals from SPM and AFNI are quite different, almost totally different...

      I can understand that the preprocessed signals can be different from these two tools. But the correlation should be the same, shouldn't it? Do you have any idea? Thank you again!


    3. Hi Tracy,

      Yes, they should be the same. Are you using the same mask in both cases?

      Instead of comparing the results of AFNI's ROI analysis with Marsbar, I would recommend comparing it to SPM's spm_get_data command, outlined here:

      I trust those results more, as I have a better idea of how the data is extracted with spm_get_data.