Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

 

MATLAB News & Notes - December 2004

Analyzing Electrical Activity and Magnetic Fields
in the Brain

Scientists Describe a MATLAB Based Tool Developed for Clinical Brain Research


by Markus Junghöfer and Peter Peyk
Universität Konstanz, Germany

How does the brain learn a foreign language or relearn speech after a stroke? How do changes in the brains of trauma victims lead to recurring anxiety states, and how can this condition be treated?

Specialists in a variety of disciplines, including biology, linguistics, mathematics, medicine, physics, and psychology, investigate these questions using the most modern instruments available to the neurosciences.

From positron emission tomography (PET) and functional magnetic resonance imaging (fMRI) to electroencephalography (EEG) and magnetoencephalography (MEG), these instruments are yielding information on brain activity at an unprecedented rate and in previously unimaginable detail. The challenge is to find analytical software that is sophisticated enough to cope with this deluge of data.

Several commercial software packages are available for analyzing EEG or MEG data. However, these packages can be inadequate for researchers who wish to use nontraditional evaluation methods or develop their own. The MATLAB based analysis package ElectroMagnetic EncaphaloGraphy Software (EMEGS) developed in the Department of Clinical Psychology at the University of Constance fills this gap.

The EMEGS Software Program

EMEGS brings together new methods and applications for analyzing neuroscientific data. Developed in MATLAB, EMEGS consists of modules for filtering, segmentation, editing, visualization, and advanced data analysis techniques.

Data Editing

Researchers can correct some interference signals by using independent measurements and performing correlation analyses: for example, an electrocardiogram can record the activity of the heart and an electrooculogram can record eye movements. External magnetic interference signals are detected by additional measuring coils. Other interference signals can often be identified by amplitude and time characteristics and unusual frequency distributions.

However, it is often difficult to differentiate among noise, background, and useful brain signals. The useful signals measured are highly complex, as the brain uses many different structures whose activities overlap in time and space and exhibit feedback mechanisms. The signal-to-noise ratio can be contaminated by biological factors, such as interference from muscle movement, and by environmental factors, such as variations in the earth’s magnetic field or moving metal bodies, such as dental fillings.

The EMEGS data editing program optimizes the signal-to-noise ratio as a solution of a function. For each sensor it establishes an individual threshold for different test parameters, such as maximum amplitudes, time gradient, standard deviation, and spectrum output within a predetermined frequency range, and extracts time intervals that show values above these thresholds. Contaminated sensors can then be interpolated on the basis of the uncontaminated data. Figure 1 illustrates the output of this process.

Artifact editing   Figure 1. Artifact editing—histogram representing the time variance of EEG potentials at 64 sensors over 1,800 epochs. Click on image to see enlarged view.

Visualization of Sensor and Source Time, Frequency, and Time-Frequency Analyses

A test subject’s brain anatomy can be measured and then incorporated into the analysis of the data. It is difficult, however, to associate the neuronal activities inside the brain with the neurophysiological functions that can be observed via EEG or MEG—in other words, to pinpoint which brain activity the signal represents.

Researchers can visualize the raw signals two-dimensionally, as time series at the corresponding sensor positions, or as three-dimensional projections based on spline interpolations of areas not covered with sensors (Figure 2).

Time series and frequency spectra   Figure 2. Top: Time series and frequency spectra (left) and time frequency mapping (right). Bottom: 3-D topographic projection of potential or magnetic field distributions and solutions of variance analysis calculations on a model head, with a projection of the results of field continuation or inverse techniques on a model brain. Click on image to see enlarged view.

Variance Analyses

EMEGS modules enable variance analytical investigations beyond individual members of a group or individual brain activations. These statistical analyses can be conducted in the sensor groups or brain areas and in the time, frequency, or time-frequency (“wavelet”) domains. In the simplest case, the time intervals and sensor groups or brain areas of interest are defined and investigated by analysis of variance (ANOVA) over the various investigative conditions and test subjects. This approach obviates the need for time-consuming data export and external data analysis using statistics packages. Researchers can, however, perform all statistical tests for each point in time and each sensor or source point and test selected contrasts for significance.

Statistical Parametric Mapping

EMEGS enables the use of Statistical Parametric Mapping (SPM) via a MATLAB based interface for statistical analysis of fMRI and PET data. Three-dimensional accelerations in brain activity calculated on the basis of EEG or MEG are stored in an SPM-compatible format. Scientists analyze this data using the broad spectrum of statistical methods available in SPM, such as parametric analysis or mixed-variance models.

Extended Analytical Features

EMEGS includes extensive features that enable scientists to generate synthetic data in epoch form (using a specific date and time as a point of reference) or already averaged, and store it in different formats to illustrate the effects of a wide variety of overlapping brain activities; investigate the effects of interference values, such as ocular artifacts, on all available analytical methods; and test custom-developed analysis methods.

Investigating Brain Activity

PET and MRI scans enable researchers to visualize the chemical signals and metabolic and circulatory processes within the brain. They provide outstanding spatial resolution, but usually measure integrative brain activity over extended periods. Time resolution in the millisecond range requires procedures that enable more detailed analysis of changes over time and the interactions of different processes in the brain.

Each of the approximately 100 billion nerve cells in the human brain can exchange signals with thousands of other neurons.When several thousand adjacent neurons are activated simultaneously, the current flows converge at the surface of the body to produce fluctuations that can be detected by EEG scans. MEG technology makes it possible to record the minute magnetic fields produced by these currents.

EEG   MEG   EEG and MEG - The electrical activity of the brain generates variations in potential at the surface of the head and magnetic fields outside the head that can be detected by electroencephalography (EEG with 256 electrodes, top) or by magnetoencephalography (bottom).

A Typical EEG or MEG Experiment

To investigate which regions of the brain are responsible for recognizing emotionally relevant stimuli, such as an approaching snake, and preparing appropriate reactions, researchers use EEG or MEG to record electrical activity from the brains of test subjects presented with emotionally charged and neutral pictures.

Scientists first see very similar reactions to both types of stimulus. Approximately 50 to 60 ms after the image is presented, an EEG or MEG component reveals the visual processing of the simplest forms of the picture in areas at the back of the brain. Subsequent components reflect successive stages of recognition, emotional evaluation, memory recall and storage, the preparation and execution of eye movements, and defensive or lid-closure reactions that occur in broad areas of the brain. After about 100 ms, the components begin to show differences. These increase over time, reflecting much stronger processing of emotionally relevant material compared with the neutral images.

Areas of the brain with increased blood flow   Areas of the brain with increased blood flow or increased MEG source activity in subjects observing emotionally stimulating and emotionally neutral images.


For more information, visit:


Contact sales
Subscribe to newsletters