The purpose of this tutorial is to get you acquainted with the concepts need to perform multi-modal integration in FreeSurfer using fMRI and DTI analysis. You will not learn how to perform fMRI or DTI analysis here; that knowledge is already assumed. The fMRI makes use of data from the Functional Biomedical Informatics Research Network (fBIRN,

fMRI Basics

In fMRI, stimuli are presented to a subject, which creates a BOLD hemodynamic response function (HRF) in certain areas of the brain. The analysis is performed by first performing motion correction, then correlating each voxel's time course with the stimulus schedule convolved with an assumed HRF shape. The result is an estimate of the HRF amplitude for each condition at each voxel, contrasts of the HRF amplitudes of various conditions, the variance of this contrast, and some measure of the signficance (eg, p, t, F, or z) map. All these maps are aligned with the motion correction template, which should be used as the registration tempate.

This Data Set

All the commands in this section should be run from this directory

cd mmtut/fmri

These are 5 subjects from the fBIRN Phase I acquisition. They are fbirn-10?, where "?" is 1, 3, 4, 5, 6 (note that #2 is missing). Each has a FreeSurfer reconstruction by the name fbirn-anat-10?.v4.

The data are the results from a sesorimotor paradigm (flashing checkerboard, audible tone, and finger tapping). The raw fMRI data were motion corrected but not smoothed. Each subject has four volumes:

template.nii - motion correction template
ces.nii - contrast effect size
cesvar.nii - variance of contrast effect size
sig.nii - signed signifiance of contrast (-log10(p))

The contrast is the contrast between the ON and the OFF (ie, a comparison against baseline). The sig.nii volume has signed -log10(p) values. So, if the p-value = .01, -log10(p) = 2. If the contrast was positive, then the value would be +2, if negative (ie, ON<OFF), then the value would be -2.

Individual Analysis

Here we are going to look at the results on a single subject.

Check Registration

First (and always), check the registration (see the Registration Tutorial for more information).

tkregister2 --mov fbirn-101/template.nii \
  --reg fbirn-101/bb.register.dat --surf

This registration should already be good, so there is no need to make any modifications. In a real analysis, you should check the registrations for all subjects, but that is not necessary here.

View sig map on anatomical volume

tkmedit fbirn-anat-101.v4 orig.mgz -aux brain -seg aparc+aseg.mgz \
  -overlay fbirn-101/sig.nii -reg fbirn-101/bb.register.dat



  1. ON>OFF is red/yellow

  2. ON<OFF is glue/cyan

  3. Notice activation in motor, auditory, and visual regions.

View sig map on left hemisphere

Before you can view the fMRI data on the surface, you must resample the data onto the surface:

mri_vol2surf --mov fbirn-101/sig.nii \
    --reg fbirn-101/bb.register.dat \
    --projfrac 0.5 --interp nearest \
    --hemi lh --o fbirn-101/lh.sig.mgh


  1. The "moveable" is the signficance map (which is in line with the template.nii used for registration).
  2. "--projfrac 0.5" indicates that the significance should be sampled half way between the white and pial surfaces.
  3. "--interp nearest" means use nearest neighbor interpolation (good for sig).

The output is lh.sig.mgh the significance sampled onto the left hemisphere. It has the same size as any other surface overlay for this subject, eg, lh.thickness. To see it's dimensions, run:

mri_info fbirn-101/lh.sig.mgh

You will see "dimensions: 164121 x 1 x 1", indicating that there are 164121 columns (ie, vertices), 1 row, and 1 "slice".

tksurfer fbirn-anat-101.v4 lh inflated -annot aparc \
  -overlay fbirn-101/lh.sig.nii 


FsTutorial/MulitModalFmri (last edited 2009-01-12 20:02:47 by crash)