SAM4d, SAM4dc Version 3

Description: SAM4d and SAM4dc compute temporo-dynamic (3D+time) event-related functions of source moment, power, or rank vector entropy, from multiple trial MEG, relative to one or more named markers. The required inputs are 1) the MEG dataset, 2) the beamformer coefficients from SAMwts, and 3) a parameter file to direct the analysis. Two NIFTI formatted images, for the mean and variance of trials are computed for each named marker.

Two versions of this program - SAM4d and SAM4dc are offered. They differ in the order in which the functions of power or RVE are parsed. The "c" in SAM4dc denotes a "continuous" analysis, as will be explained.

SAM4d first applies the beamformer coefficients to the filtered MEG data (using ImageBand) to compute the source time series for each marked trial (the start and end times relative to each named marker). Next, the time-series of the metric function (source moment, Hilbert envelope of power, or rank vector entropy) is computed for each trial. A boxcar integrator (designated by the keyword TimeInt) is applied to resample the metric time-series at the sample rate indicated by the TimeStep keyword. The mean and variance at each sample latency (for each marker and voxel) is computed and written to their respective 3D+time NIFTI image files. If, for example, there were three named markers, the output will be six NIFTI image files - a mean and variance file for each marker.

By contrast, SAM4dc applies the beamformer weights to the filtered MEG data over the entire time series - without respect to epochs or markers. The metric function (source moment, Hilbert envelope of power, or rank vector entropy) is then computed continuously over the entire time series and lowpass filtered using an anti-aliasing (smoothing filter) before resampling to the rate indicated by the TimeStep parameter. The resulting metric time series for every voxel is then parsed into trials and the mean and variance accumulated over all trials for each marker and then written to their respective image files.

The problem that arises for SAM4d is that the functions of power and especially RVE are biased by their being computed over the segments of each trial. Short time segments add uncertainties to these measures. To reduce this bias, SAM4dc computes power and entropy over the entire dataset time series, for every voxel. This makes SAM4d faster than SAM4dc.

Nonetheless, it is strongly recommended that the SAM4dc is used in the analysis.

Usage:

SAM4d -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 SAM3d works silently.

The NIFTI image files will be either "ortho" (the designated ROI and grid spacing from the parameter file) or "tlrc" (Talairach space and resolution) depending upon the ImageFormat keyword used to compute the SAM weights.

SAM4d and SAM4dc differ as to which beamformer weights are permitted. The beamformer weights are designated in the parameter file by the CovType keyword. SAM4d will accept one of these: "CovType GLOBAL" - where the beamformer weights computed over the entire dataset, are applied, "CovType SUM" - where the beamformer weights for the sum of all marked trials, are applied, or "CovType ALL" - where the beamformer weights for each named marker are applied. Although the independent beamformer weights (ALL) are permitted in SAM4d, they may introduce unwanted bias because they are derived from the covariance of short data segments. The SUM or GLOBAL weights should be used whenever possible. SAM4dc permits only the SUM or GLOBAL weights.

The required parameter file keywords for SAM4d and SAM4dc are:

Optional keywords include:

Examples parameters for imaging beta-band power in the presence of broad-band noise, in Taliarach space on an 8mm grid for SAM4d or SAM4dc:

Two 3D+time image files for the mean and variance of each of the three markers (6 image file total) will be output to the named directory.

NumMarkers 3
Marker1 9r0 -0.25 0.25 TRUE
Marker2 9r1 -0.25 0.25 TRUE
Marker3 9r2 -0.25 0.25 TRUE
XBounds -10 10
YBounds -9 9
ZBounds -2 15
ImageStep 0.5
TimeStep 0.005
TimeInt 0.010 (for SAM4d, only)
SmoothBand 0 20 (for SAM4dc, only)
ImageFormat TLRC 8.0
CovBand 4 50
ImageBand 14 30
ImageMetric Power
CovType SUM
MRIDirectory /data1/mri
ImageDirectory /data1/N-Back,1200/Images