Sam wts

From MEG Core
Revision as of 14:24, 4 March 2019 by Nugenta (talk | contribs)
Jump to navigation Jump to search

Return to Source Localization - SAM

Description

sam_wts computes linearly constrained minimum variance (LCMV) beamformer coefficients (SAM weights) for any designated ROI or target voxel list using the covariance files within the named dataset, calculated by sam_cov. sam_wts is a scalar beamformer in which the optimal source dipole orientation is determined first, followed by computation of the scalar weights. Source orientation is estimated from a separate orientation covariance matrix (Orient.cov) that uses all data samples and a specified passband (ideally one in which signal-to-noise is optimal; see sam_cov). It is assumed that source orientation is stationary across time, whereas source amplitude may be non-stationary.

In contrast to setting up a rectilinear grid by hand, an “atlas” file (created from a FreeSurfer parcellation) containing the position and orientation vectors of neocortical sources can be designated with the Atlas parameter. If the atlas file is present, the source grid (ROI and voxel spacing) is predetermined and the orientation estimate step is bypassed. In addition, the parameter file can designate a transform used to refine the translation and rotation of the atlas file. Generation of an atlas file requires FreeSurfer, FSnormals.py, and reduce_surface.py. If an atlas is specified, sam_wts will only solve for voxels that are immediate neighbors to the FreeSurfer surface, which will produce a sparse representation in a rectilinear voxel space.

Three forward models are available for computing weights that are selectable using the Model parameter:

  • A single homogeneously conducting sphere, computed using the Sarvas equation.
  • Multiple local spheres, one per sensor, also computed with Sarvas.
  • A realistic head model (using the Nolte equations) computed

with an estimate of the inner skull surface as determined by the AFNI program 3dSkullStrip.

If desired, the covariance matrix can be regularized by adding a fixed noise value to its diagonal using the Mu or PropMu parameters. Regularization is in units of fT/\surdHz.

Users who wish to develop real-time beamforming can also output a file containing the forward solutions for a small list of target locations using the -B option together with specifying a target file using the TargetName parameter (or -t).

The output of sam_wts is a NIFTI file (number of voxels x number of sensors). In this format the SAM coefficients can be transformed to Talairach space by specifying ImageFormat TLRC RES (where RES is the grid spacing in millimetres) in the parameter file. This results in a second NIFTI file with a suffix of _at.nii, labeling it as @auto_tlrc output. If ImageFormat is absent, the weights default to the coordinates and grid spacing specified in the parameter ROI, as designated by XBounds, YBounds, ZBounds, and ImageStep. The user can also use ImageFormat ORIG, for which the output is .nii, only.

Transformation of the SAM coefficients to Talairach space requires that the specified subject has an MRI that has been transformed to Talairach space. The recommended procedure is to run orthohull using the -t option on the subject’s anat+orig AFNI image file. This generates an image file named brain+tlrc that is read by the sam_wts program when ImageFormat TLRC is specified.

The advantage of specifying Talairach space SAM weights is that subsequent analyses are automatically rendered in Talairach space for group studies. sam_wts calls the AFNI program @auto_tlrc, using nearest neighbor transformation (-rmode NN). In order to minimize the positional errors in Talairach space, it is recommended that ImageStep designates a finer grid spacing than the transformation. For example, a parameter file containing:

XBounds 10 10 YBounds -9 9 ZBounds 0 15 ImageStep .5 ImageFormat TLRC 8. will compute SAM weights on a 5 mm grid and transform this to an 8 mm Talairach grid, using the nearest neighbors in ortho space for the corresponding weight in Talairach space.

It’s also perfectly fine to run @auto_tlrc separately on the functional images produced by other SAM programs (such as sam_3d).

Usage

 sam_wts -r <dataset_name> -m <parameter_file_name> [-v] [options]

The -r flag designates the dataset name (with or without the .ds suffix), -m designates the parameter file name, and -v is “verbose” mode. Without -v, sam_wts works silently, except for error messages.

Other options:

-Z: Normalize the SAM weights by the projected noise. -B: Output forward solutions (used together with parameter “TargetName”). Parameters: The parameters specific to sam_wts include:

NumMarkers Marker1 Marker2 … Marker6 XBounds YBounds ZBounds ImageStep MRIDirectory TargetName ImageFormat Atlas Transform Mu Model PrefixLength Example parameter file for a rectangular ROI in “ortho” space:

NumMarkers 3 Marker1 9r0 -.25 .25 TRUE Marker2 9r1 -.25 .25 TRUE Marker3 9r2 -.25 .25 TRUE CovBand 4 100 ImageBand 35 45 OrientBand 14 30 XBounds -12 12 YBounds -9 9 ZBounds -2 15 ImageStep .5 Model Nolte Example parameter file using a cortical Atlas:

NumMarkers 2 Marker1 9r0 -.25 .25 TRUE Marker2 9r1 -.25 .25 TRUE CovBand 0 100 ImageBand 14 30 OrientBand 14 30 Atlas example.mesh MRIDirectory WXYZABCD PrefixLength 8 TargetName example_targets Model Nolte Input File Formats:

Target File The named target file must be located in the subject’s MRI subdirectory (specified by the MRIDirectory and PrefixLength keywords). Each line has three numbers — the x, y, and z-coordinates in centimeters (separated by whitespace). Atlas File Each line has six numbers — the x, y, and z-coordinates (meters) and x, y, and z orientation (unit vector) (separated by whitespace). Notes The TargetName parameter takes precedence over the ROI specifications. If both are present, only the target list will be used. This directs sam_wts to compute legacy formatted weights in the dataset SAM subdirectory. The targets may be specified with or without the Atlas parameter.

The target file used in the current version of SAM must not have the number of targets in the first line. Instead, each line contains the x, y, z coordinates (cm) separated by tabs or spaces and terminated by a newline character.

Increasing the CovBand bandwidth is very useful for improving attenuation of strong interference such as from tDCS, tACS, and vagus nerve stimulators.

DataEditor can be used to view the virtual sensor (source) time-series for a small number of target locations by reading its SAM weights. If the -Z flag is used to generate the weights, the units will be beamformer output signal-to-noise. Otherwise, the units are A-m.

A target file can be generated by NIFTIPeak, which reads a SAM image file (.nii) and finds its local maxima. The maxima coordinates are output to a .max file in order of their magnitude. This file must be moved or copied to the subject’s MRI subdirectory.