NIMH MEG Core Facility

National Institute of Mental Health, Bethesda, Maryland

Main

MEG Analysis

Valid XHTML 1.0!

Valid CSS!

view · edit · attach · print

Basic SAM Analysis

Introduction

There are two basic types of SAM analysis, single-state and dual-state imaging. In either case, SAM estimates the source power for each voxel in the brain, using a beamformer. Because of the way beamformers work, the raw source power estimate increases with depth, and so must be normalized somehow. In single-state imaging, the normalization is accomplished using a noise estimate, which assumes a small, constant noise. In dual-state imaging, the normalization is done using real brain noise, a so-called control state. In this case the state being normalized is called the active state.

Generally, you'll want to use dual-state imaging, both because the noise normalization is more accurate, and because one often wants to compare active and control conditions.

There are also two main options for doing dual-state analysis, resulting in either pseudo-T or pseudo-F images. The pseudo-T is basically a subtraction of active minus control, while the pseudo-F computes active divided by control. Since source power is basically the same as the variance, the pseudo-F is easy to understand as a ratio of variances (hence the name).

There should not be any practical difference between pseudo-T and pseudo-F, we'll use pseudo-F here.

Preliminaries I — Head model preparation

Before doing a SAM analysis, you must create a head model for each subject, which is used in magnetic field calculations. The head model consists of a head shape, which is typically either the outer skull surface or a smooth approximation of the brain surface, and a sphere model. The head is often modelled as a homogenous conducting sphere in order to account for volume-conducted return currents. The sphere model used here is a multiple local-sphere model, where each sphere (one per MEG sensor) is fit to a small patch of the head model (directly under the sensor) in order to better model the local return currents.

Once the head model is prepared, the localSpheres program creates a unique sphere model for each dataset.

Preliminaries II — Markers and time windows

Experimental datasets contain various events of interest (e.g., stimulus onsets, response button presses, etc.). Markers define the times for these events within the dataset.

Once your dataset is marked, you must also define time windows (using the markers) that give the active and control states to be used by SAM analysis. Time windows are stored in text files in the SAM subdirectory of the dataset. Their format is like this (for a dual-state image):

1
active t0 t1
1
control t0 t1

That is, first the active windows and then the control windows. The '1' gives number of windows; you can have several. t0 and t1 are times, in seconds, and "active" and "control" are markers.

For example, if you have a marker called "stim" defining a stimulus onset, and are interested in a post vs. pre comparison, you might say:

1
stim 0 .5
1
stim -.5 0

That is, the active window is half a second post-stim, and the control window is half a second pre-stim. Or if you have two different kinds of stimuli that you want to control for, you might say:

1
stim1 0 .5
2
stim1 -.5 0
stim2 -.5 0

Running SAMcov and SAMsrc

An actual SAM run consists of computing a covariance matrix from the MEG data using SAMcov, and then using that covariance matrix to estimate source power inside the brain using SAMsrc.

SAMcov -r $ds -m $cond -f "$lo $hi" -v

Here, $ds is a shell variable containing the dataset name, $cond is the name of the file defining the active and control time windows, and $lo and $hi define the frequency band to use.

SAMsrc -r $ds -c ${cond},${lo}-${hi}Hz -D3 \
        -x '-10 12' -y '-8 8' -z '0 14' -s 0.5 -p -v

Here, the shell variables are the same, except they have been protected with curly brackets (avoiding things like $hiHz being a variable). The -D3 option specifies a pseudo-F analysis, the -x, -y, and -z options specify the ROI in centimeters (the values shown are often adequate), and -s specifies the voxel size to use (in cm). See the SAMsrc help for the meanings of the other options. One that is not shown here that might be useful is -u, which specifies a regularization parameter (see the state imbalance page).

Once you've computed a covariance matrix, you can run SAMsrc multiple times to see the effect of varying the parameters. Generally though, one computes them together, using a script. An example of such a script is dosam:

#! /bin/bash

test "$#" -ne 1 && echo usage: $0 dataset && exit 1
ds="$1"

doit() {
        lo=$1
        hi=$2
        cond=$3

        cp $3 $ds/SAM/
        SAMcov -r $ds -m $cond -f "$lo $hi" -v
        SAMsrc -r $ds -c ${cond},${lo}-${hi}Hz -D3 \
                -x '-10 12' -y '-8 8' -z '0 14' -s 0.5 -p -v
}

doit 14 30 cond1

Here, the dataset is passed as the first argument to the script ($1), doit() is a function that computes one SAM image, and the doit command at the end specifies a SAM computation in the beta band for cond1. cond1 is the name of a file (here copied from the current directory into $ds/SAM) containing the time window definition, it must have been created previously. The band shown is an example only, see Frequency Bands or just explore.

 
view · edit · attach · print · history · recent changes
Page last modified on November 10, 2009, at 02:46 PM
 
Department of Health and Human Services image and link First Gov image and link