SAMepi Version 3

Description: SAMepi is the succesor to the SAMg2 analysis that was included with the VSM/CTF software package. SAMepi differs from SAMg2 in that it applies excess kurtosis analysis to short overlapping time segments (specified by the TimeInt parameter) instead of applying it to the entire time series. The excess kutosis is computed for the source time-series of each voxel, as:

Excess kutosis (g2) is positive for time-series with outliers or rare events (such as spikes), negative for rhythmic activity, and zero for random Gaussian signals. The legacy SAMg2 analysis had an issue in that voxels at locations of extremely rare spikes had a large g2 whereas more frequently spiking regions had lower g2 values. In the limit, a region having frequent epileptic spikes may not be identified because its activity is not "rare".

SAMepi improves the contrast of frequently spiking regions by computing g2 for short overlapping segments — typically 0.5 to 5 seconds and solving for the rms value of all segments with a positive g2 to obtain the voxel value. This is a variant of the strategy of taking the mean value that was suggested by Y. Harpaz at Bar Ilan University.

SAMepi reads the MEG dataset and a set of beamformer coefficients (weights) computed by SAMwts. The data are bandpass filtered according to the ImageBand specification — usually 20-70 Hz. The value assigned to each voxel is the average g2 for all segments, and written to a NIFTI 3D image file.

The local maxima in the SAMepi image can subsequently be identified by NIFTIPeak and beamformer coefficients computed for those maxima using SAMwts for viewing the source time-series (virtual sensors) using the CTF DataEditor or equivalent software/

It is highly recommended that SAMepi be compiled using the OpenMP multi-processor library (Linux "libgomp"). This will enable the computationally intensive excess kurtosis to run on all available CPU cores.

Usage:

SAMepi -r < dataset_name > -m < parameter_file_name > -v

The -r flag is followed by the dataset name (with or without the .ds suffix). The -m flag is followed by the parameter file name without the .param suffix. The -v argument specifies verbose output - else SAMepi works silently.

For VSM/CTF MEG users, SAMepi looks for "bad.segments" and "Bad.Channels" within the dataset directory. These files can be created and edited using the DataEditor program. Bad time segments can be marked where there are artifacts such as from jaw muscles, swallowing, or head movement. Additionally, bad channels can be deleted from the analyses.

Here is an example parameter file for spike imaging:

NumMarkers 0
CovBand 4.0 150.0
ImageBand 20.0 70.0
OrientBand 14.0 30.0
XBounds -10.0 10.0
YBounds -9.0 9.0
ZBounds -2.0 15.0
ImageStep 0.5
ImageMetric Kurtosis
TimeInt 2.0
Model Nolte
CovType GLOBAL

These are user selectable parameters representing a good starting point for imaging interictal spikes. The 20-70 Hz ImageBand bandpass usually gives the best contrast but can be adjusted to suit each case. The 4-150 Hz CovBand bandpass includes frequencies outside the limits of ImageBand so that artifacts from (e.g.) vagus nerve stimulators can be included in the weight computation. The TimeStep parameter can also be adjusted to improve contrast — depending upon how frequently the spikes occur. For ictal activity such as electrographic seizures, TimeInt should be very short (0.5 seconds)

A shell script for analyzing an epilepsy dataset using the above parameter file, named "Spikes.param" is:

SAMcov -r XYZABC_epilepsy -m Spikes -v
SAMwts -r XYZABC_epilepsy -m Spikes -v
SAMepi -r XYZABC_epilepsy -m Spikes -v