NIMH MEG Core Facility

National Institute of Mental Health, Bethesda, Maryland

Main

MEG Analysis

Valid XHTML 1.0!

Valid CSS!

view · edit · attach · print

Virtual Channels

A virtual channel is similar to a regular MEG channel, except that it is tuned to a particular source. When you perform a regular SAM analysis, a beamformer is calculated for each voxel of the image, and the beamformer is used to calculate a source power estimate. To calculate a virtual channel, the same beamformer is used, but in a different way. A beamformer is just a set of coefficients, or weights, one for each channel, and a virtual channel is just a weighted sum of all the MEG channels with those weights.

To calculate a virtual channel, do something like this:

SAMsrc [other options] -r $ds -c $cov -t targets -W 0

The -t targets option specifies a file called targets in the SAM subdirectory of $ds. The -W option specifies an SNR threshold below which the weights will be set to zero; using 0 here means the weights will always be output unless the SNR is less than 1. Target locations are specified in head coordinates (or PRI coordinates in AFNI nomenclature). AFNI's default is RAI (Right, Anterrior, Inferrior), CTF's default is PRI (Posterior, Right Inferior.) In addition, AFNI coordinates are in millimeters and CTF coordinates are in centimeters. So if your AFNI RAI co-ordinates are 21, 29, 99, your CTF coordinates in PRI would be −2.9, 2.1, 9.9). An example file might look like this:

2
1.35 −2.07 2.54
-2.99 −3.74 3.73

This specifies 2 target voxels, both on the right side. If you've done a group analysis, and have target voxel locations in Talairach coordinates, they'll have to be converted. See Vecwarp for how to do that.

SAMsrc will save the resulting weights in a file called $ds/SAM/$cov,targets.wts. To apply them, you must use newDs (or newDs2). Since the weights were calculated from the covariance matrix, and the covariance matrix was calculated for a given time-frequency window in the MEG data, the virtual channel is only valid for that window. In other words, you may only apply the weights to the same set of data that went in to the covariance calculation. So for example, if you had run SAMcov like this:

SAMcov -v -m prepost -r $ds -f "30 50"

where the prepost file in the SAM subdirectory looks like this:

1
stim -.3 .7

then the time-frequency window is a 1 second window around the stim marker, in the 30–50 Hz band. (The $cov variable in this case would contain prepost,30–50Hz.) Assuming that you have a dataset that has already been filtered in that band, you can use newDs like this:

newDs -marker stim -time -.3 .7 -includeSAM $cov,targets.wts $ds $newds

to create a dataset $newds that contains the virtual channels. They will be named V0 and V1 in this case, and so on, depending on how many targets you have. You can use the -filter and -process options of newDs to filter the data on the fly, or you can use the newDs2 program like this:

newDs2 -marker stim -time -.4 .8 -band 30 50 \
     -includeSAM $cov,targets.wts -excludeMEG $ds $newds 

Notice that in this case I've added a small amount to the time window on either side, to allow the filters to settle. If you prefilter the entire dataset you wouldn't need to do that, but that takes up a lot of extra space, so newDs2 is often more convenient. Also the -excludeMEG option will cause the output to contain only the virtual channels, and be much smaller.

Once the virtual channel dataset is created, you can start looking at it. A straight average is not going to be very useful, unless your frequency band starts from 0 Hz. The reason is that high frequency waves are not likely to be in-phase with respect to the target marker (but see InducedEvoked). So, you'll need to run something like rmspowerDs or hilbertDs to generate an envelope and average that, or perform a time-frequency analysis? on the virtual channels using something like ctf2st (a Matlab script) or StockwellDs (a Python script).

 
view · edit · attach · print · history · recent changes
Page last modified on August 13, 2008, at 10:25 AM
 
Department of Health and Human Services image and link First Gov image and link