Analyzing the Data

To describe the steps in fMRI data analysis, we will consider a hypothetical session performed on subject John Smith on Oct. 24, 1997 at about ten o'clock in the morning. The session consisted of:

    three frames  rest, three frames hot stimulus, three frames rest , three frames warm stimulus, repeated 10 times

    the above paradigm was repeated.

After the experiment the data were transferred to the fMRI' node.

Finding the Transferred Images

After the data transfer is finished, the data reside in MINC files on ~fmrixfer/images on bottom. For our hypothetical session, we would find the following files:
    {smith_john} is the subject's name.

    {_19971024_} is the date of the session.

    {_1_1_mri} indicates the first anatomic scan of the MRI session (the first `_1_' can be ignored). We know that the first scan in the session was the short scout acquisition. We generally don't need to keep this scan, but it is usually transferred anyway.

    {.mnc} indicates that this is a MINC file

    {.gz} indicates that the file has been compressed using the `gzip' program.


Here the field {_1_2_mri} indicates that this is the second anatomic scan of the MRI session. This is therefore the T1-weighted anatomic scan. We will use this scan to interpret the functional data in an anatomic context. The file contains all of the slices of this 3D cross-sectional data set (usually 150-170 slices).


In functional scanning runs, which are dynamic (i.e. they have a time dimension), the file identification field works differently from that of anatomic scans. These files contain multiple volumetric scans - in this case 120 per file - one for each time point in a functional scanning run. These are the files which will be processed to produce activation maps.

Here the field {_1_105235_mri} indicates that this is a dynamic scanning run which was started at the time 10h52m35s (again, you can ignore the initial `_1_'). Subsequent functional scanning runs would then be named according to their start times as follows:


Finding the analysis software

The programs what you might need, and their locations, are listed below:
      Application         Location
fmr_preprocess  /usr/local/mni/bin/
fmridesign.m /usr/local/matlab5/toolbox/fmri/
fmrilm  /usr/local/matlab5/toolbox/fmri
multistat.m /usr/local/matlab5/toolbox/fmri/
tstat_threshold.m /usr/local/matlab5/toolbox/fmri/

You can access fmridesign.m, fmrilm,multistat.m and tstat_threshold.m  directly in MATLAB, you don't have to add any path, to your MATLAB environment.

Setting up a Working Directory

You should first set up a subdirectory for analysis of the session on  /data/fmri/analysis/ or on one of the /scratch disks on bottom (/scratch1 or /scratch2). If you don't have access to the /data/fmri/analysis/ directory, ask Peter Neelin (, or Jean-Francois Malouin ( to give you permission to write in that directory. Make a separate directory for the dynamic data, and copy the data over from ~fmrixfer/images e.g.

mkdir /data/fmri/analysis/yourname

mkdir /data/fmri/analysis/yourname/john_smith

mkdir /data/fmri/analysis/yourname/john_smith/dynamic

cd /data/fmri/analysis/yourname/john_smith

cp ~fmrixfer/images/smith_john_19971024_1_2_mri.mnc.gz .

cp ~fmrixfer/images/smith_john_19971024_1_??????_mri.mnc.gz ./dynamic

Preprocessing the Data

Before generating an activation map we recommend performing motion correction and low pass filtering the dynamic data.

During dynamic data acquisition the subject may execute slight transient head movements due to breathing, swallowing, and the activation condition itself. Their head position may also drift over a longer time scale. Such motion can cause spurious intensity changes in the dynamic data which can either obscure or mimic true activation induced signal changes. We therefore correct the data by registering all image frames in each dynamic file to one single target in that run.

Preprocessing is performed using the program `fmr_preprocess,' which also low-pass filters (blurs) the dynamic data (blurring is the default but can be disabled). Low-pass filtering increases the signal-to-noise ratio of the data, increases the tolerance of the subsequent analysis steps to residual motion in the scans, and minimizes resampling artifacts.

We would preprocess each dynamic run one at a time, by going to the directory /data/fmri/analysis/yourname/john_smith/dynamic and typing the command fmr_preprocess on the unix command line, followed by the list of options you want to process and the file name. A list of options will be given if you type fmr_preprocess -h. You can write for e.g.

fmr_preprocess  -fwhm 6 -target 3 smith_john_19971024_1_105235_mri.mnc.gz

This will blur, low pass filter, your image with a 6 mm FWHM Gaussian filter  and also it will align your frames to the third frame in the first run. The new files that are created have the suffix  `_MC'  (for Motion Corrected) e.g.

Note that the output files are not compressed, so they don't have the .gz extension.

All 120 volumetric frames in all four scanning runs will be registered by default to the third frame in the respective run. The first couple of frames must not be used as registration targets, because they do not represent `steady-state images.' Each volumetric frame will also by default be low-pass filtered with a 6 mm FWHM Gaussian kernel. If you would like use a different filter, you just have to change the fwhm parameter. If you would like to register your frames to a different  target, just specify the target number.

Previous Next Back to table of contexts