|
|
|
MEGAN: A Software Package for MEG and EEG Analysis & Visualization
Neural ElectroMagnetic (NEM) methods, (MEG and EEG) allow noninvasive
study of neuronal activity in the brain by measuring the magnetic field
outside the head or the electric potential on the scalp. For decades
EEG (and more recently MEG) have been employed for investigating the
temporal dynamics of neural population activity. The more recent
use of NEM techniques for localizing current sources within the brain
creates additional technical and analytical requirements. We have
developed the software package MEGAN in response to the requirements
for reliable signal processing, data visualization, source localization
and temporal analysis capabilities, and a convenient user interface,
with the intent to make it available to the brain mapping community.
System Capabilities: MEG/EEG data comes in a variety of
formats, depending upon the sensor system that was used, on the form
in which the data was saved, and on the type of experiment that was
done. MEGAN currently handles MEG data from several sensor systems
and is being extended to accept user-written modules to read data from
other systems and to provide full support for EEG data. It supports
both continuous and averaged evoked response data. Continuous
data may consist of spontaneous activity or may contain embedded sensory
or behavioral responses; MEGAN provides capability for retrospective
averaging relative to a stimulus or response record. This capability
facilitates experimental paradigms that employ rapid or complex designs
that produce temporally overlapping responses. MEGAN provides a rich
variety of visualization options for selecting epochs of spontaneous
data, data conditioning, and viewing of the data in a variety of forms,
for example as field distributions or as waveform displays. All
of the forms of data that MEGAN handles can be written to our standard
netMEG file, a flexible, extensible, self-documenting,
and highly portable file, written using the netCDF format. We
have developed code to read the netMEG file into programs written in
C, Fortran, MATLAB and IDL. MEGAN is written in IDL, which has
many advantages as a development and interactive runtime environment.
MEGAN emphasizes signal processing because NEM data is especially vulnerable
to noise contamination, both from the subject's own body and from environmental
sources, such as the 60 Hz AC power signal. A variety of sensor
designs, hardware filters, and shielding are used to reduce recorded
noise, but digital filtering and artifact rejection in post-processing
are also useful. MEGAN offers a great deal of flexibility and
user control in signal processing, with options tailored to each type
of data, as well as general, highly configurable signal processing routines,
and the ability to call user-supplied routines. Capabilities for
Fourier analyses are provided, both for analysis of oscillatory activity
and as tools for digital filtering. MEGAN is an event driven program,
with the user controlling the flow of processing by means of a point
and click graphical user interface. It can also be run in batch
mode using an automatically developed script. NEM experimental
designs often employ many resolvable variations of a stimulus or behavioral
response during a single experimental session. MEGAN allows these
cases to be analyzed separately using the same processing stream, in
order to facilitate comparisons between experimental conditions.
Localization of the sources of neuronal activity using NEM methods
requires explicit computational models of the sources and of head
volume conductivity; even with such models, results are ambiguous.
Geometrical models of head and cortical anatomy provided by another
software tool developed in our laboratory, MRIVIEW,
can improve the accuracy and reliability of such estimates. Widely
used analytical strategies such as multi-dipole spatial temporal modeling
are powerful but are highly interactive. Newer strategies including
automatic multi-start methods, constrained linear inverse procedures
and Bayesian analysis can proceed automatically after setup but may
require considerable computing time. MEGAN handles such computationally
intensive tasks by spawning independent processes that can proceed while
the interactive process remains available for use. Results from
such analyses may be retrieved by MEGAN for visualization and further
analysis. MEGAN currently supports two multi-start routines, and
provides mechanisms to accommodate new methods as they mature. A few
examples of MEGAN screens follow, illustrating the three major areas
of MEGAN functionality: signal processing, data visualization, and data
analysis.
(click to enlarge)
The Channel Selector is a user interface for finding and inactivating
bad channels. The data shown here is from an MEG visual evoked
response study done on the Neuromag whole head system. Each subplot
displays the signal for one stimulus condition from all channels.
The user has clicked on a questionable waveform in one plot, and the
corresponding waveforms in all of the subplots have been highlighted.
The "Selected Channel" box indicates that the selected waveform is from
Channel 106, and the "Channel Passes" list shows that, on average,
only 28 epochs from this channel survived the artifact rejection process
for each stimulus condition. The "Stimulus, Averaged Passes Used"
list to the left, shows that there were originally at least 77 epochs
of data for each stimulus condition. The data from channel 106
can be inactivated by clicking the button next to its name on the lower
right.
(click to enlarge)
(click to enlarge)
The Waveform Location and Waveform Overplots windows are shown above.
In the Waveform Location window, each waveform is plotted starting from
the location of its sensor, projected onto a plane. A variety
of projection methods are available; in this case, the user has selected
the azimuthal equidistant projection, which shows the entire surface,
flattened out. We are looking down upon the head; the subject's
nose would be at the top of the plot. The data is from the Neuromag
system, which has a pair of planar gradiometers at each location.
The user has chosen the option to use a vertical offset to separate
the pairs of waveforms from collocated sensors. The Waveform Location
window is a graphical user interface which enables the user to click
on waveforms to inactivate them or to select channels of data to display
in the Waveform Overplots window.The Waveform Overplots window, which
shows selected waveforms plotted on the same axis, is useful for
determining the onset and duration of the response or spike, and for
seeing the maximum and minimum amplitudes. Clicking in the Overplots
window will select a waveform or, as shown in this example, a time slice.
A vertical marker appears at the selected time on each waveform in the
Waveform Location window, and the contour plot for that time slice can
be displayed. If waveform mode were selected, the selected waveform
would be highlighted in both the Overplot and Waveform Location windows.
(click to enlarge)
MEGAN supports source localization both by launching calculations,
and by supplying visualizations of the results. In this example,
a source localization calculation on somatosensory data was done using
MSST, a multistart downhill simplex method for fitting dipoles.
MEGAN offers a variety of results plots, depending upon the information
available from the analysis code. In the series of contour plots at
selected time slices shown above, the forward solution, the field due
to the calculated dipoles, is compared to the original data. The
difference between these two is the residual, the remaining signal that
is not explained by the solution dipoles. The contour plots provide
information about the magnitude of the residual, as well as spatial
and temporal variations in goodness of fit. The projection used
for these contour plots is the same as the one described for the Waveform
Location plot.
|
|
|