https://megcore.nih.gov/index.php?title=Sam_ers_and_sam_ersc&feed=atom&action=historySam ers and sam ersc - Revision history2022-08-14T22:03:48ZRevision history for this page on the wikiMediaWiki 1.35.1https://megcore.nih.gov/index.php?title=Sam_ers_and_sam_ersc&diff=3950&oldid=prevNugenta: Created page with " Return to Source Localization - SAM ==Description== The sam_ers and sam_ersc programs are closely related to the sam_4d and sam_4dc |sam_4d..."2019-03-07T22:15:27Z<p>Created page with "<a href="/index.php/Source_Localization_-_SAM" title="Source Localization - SAM"> Return to Source Localization - SAM</a> ==Description== The sam_ers and sam_ersc programs are closely related to the sam_4d and sam_4dc |sam_4d..."</p>
<p><b>New page</b></p><div>[[Source Localization - SAM | Return to Source Localization - SAM]]<br />
<br />
==Description==<br />
<br />
The sam_ers and sam_ersc programs are closely related to the [[sam_4d and sam_4dc |sam_4d and sam_4dc]] programs, and have some overlapping functionality. Like [[sam_4d and sam_4dc |sam_4d and sam_4dc]], sam_ers and sam_ersc will take the output of sam_wts (or sam_Nwts, roi_wts, or patch_wts) and produce a 3D+time NIFTI format image. The output units of the image are either moment (signal/noise) or power. In addition, sam_ersc can produce images of rank vector entropy or conditional rank vector entropy. sam_ers and sam_ersc will output an averaged timeseries, in the requested image metric, with the baseline subtracted (if requested). If two markers are given in the parameter file, the difference is computed. <br />
<br />
Two versions of this program — sam_ers and sam_ersc are offered. sam_ers can compute averages of source moment or power, while sam_ersc can additionally compute averages of rank vector entropy. The “c” in sam_ersc denotes a “continuous” analysis, as will be explained, below.<br />
<br />
sam_ers applies the beamformer coefficients to the filtered MEG data (using ImageBand) to compute the sensor time series for each trial (the start and end times relative to each named marker) — including a baseline segment specified by the keyword Baseline. If, the ImageMetric is power, the sensor-space Hilbert envelope (unsmoothed) is computed for each trial. The average is accumulated over all trials. The sensor averages of moment or power are than projected to source space using the SAM coefficients computed by sam_wts. The source-space output is resampled as specified by the keyword TimeStep, and smoothed using a boxcar integrator, as specified by TimeInt. The output 3D+time image is written to a NIFTI file.<br />
<br />
sam_ersc reads and filters the MEG data according to the ImageBand keyword. The filtered data are then projected into source space for each voxel. The voxel (source) time series is computed over the entire dataset without respect to trials or markers. If power or rank vector entropy are selected as the ImageMetric, the voxel source time-series is transformed to that metric, using either Hilbert envelope, RVE, or conditional RVE. If power is selected, the Hilbert envelope is then lowpass filtered according to the SmoothBand keyword. The voxel time-series are subsequently parsed into trials and signal averaged, followed by baseline removal according to the Baseline keyword. The average is then resampled according to the TimeStep parameter. The averaged evoked response of source moment, power, RVE or conditional RVE are then written to a 3D+time NIFTI file.<br />
<br />
Although sam_ers will run significantly faster than sam_ersc, sam_ersc is more accurate and is the recommended program of choice.<br />
<br />
==Usage==<br />
<br />
sam_ers -r <dataset_name> -m <parameter_file_name> [options]<br />
sam_ersc -r <dataset_name> -m <parameter_file_name> [options]<br />
<br />
The -r flag designates the dataset name (with or without the .ds suffix), and -m designates the parameter file name.<br />
<br />
Other options:<br />
<br />
-v Verbose mode, without this flag sam_wts works silently except for error messages<br />
-a Designates that the output be the absolute value of the specified metric<br />
-h Show help<br />
<br />
Required Parameters:<br />
<br />
CovBand: Bandpass for the covariance matrices (and directory for weights files)<br />
ImageBand: Bandpass for the image<br />
ImageMetric: Can be MOMENT, POWER, or RVE<br />
TimeStep: designates the sampling interval for the output timeseries<br />
TimInt: designates the duration for the boxcar integration <br />
SmoothBand: designates the anti-aliasing lowpass filter<br />
NumMarkers: Number of markers used in the analysis<br />
MarkerN: Marker specification details<br />
CovType: Which covariance/weights are used for the image<br />
<br />
It is important to note that when using sam_ers, GLOBAL, SUM, or ALL can be chosen for CovType. However, use of the ALL beamformer weights may introduce unwanted bias because they are derived from the covariance of short data segments. Because sam_ersc computes the power continuously across the entire dataset, only the SUM or GLOBAL options are allowed for CovType.<br />
<br />
Optional Parameters:<br />
<br />
Baseline: if given, the computed metric averaged over the baseline will be subtracted from the timeseries<br />
SignSegment: Designates a time interval over which the moment should be positive<br />
ImageFormat: Designates whether the weights are in +orig or +tlrc space<br />
ImageDirectory: Directory where the output images are written, default is the SAM directory<br />
PrefixLength: Number of characters in the MEG dataset name used for naming MRI files.<br />
<br />
==Output Files==<br />
<br />
The output from sam_ers and sam_ersc is a single 3D+time NIFTI format image. The image will be in either +orig (ortho) space are +tlrc (Talairach) space depending on the value of ImageFormat.</div>Nugenta