Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

41
Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh

Transcript of Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Page 1: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Pre-processing for EEG and MEG

Przemek Tomalski &

Kathrin Cohen Kadosh

Page 2: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Recording EEG

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 3: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Two crucial steps Activity caused by your stimulus (ERP) is

‘hidden’ within continuous EEG stream ERP is your ‘signal’, all else in EEG is ‘noise’ Event-related activity should not be random, we

assume all else is Epoching – cutting the data into chunks referenced

to stimulus presentation Averaging – calculating the mean value for each

time-point across all epochs

Page 4: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Extracting ERP from EEG

ERPs emerge from EEG as you average trials together

Page 5: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Overview Pre-processing

Converting the data Epoching/Segmentation Filtering Artifact Detection/Rejection Averaging Re-referencing

Page 6: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Convert the data

Page 7: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.
Page 8: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Overview Pre-processing

Converting the data Epoching /Segmentation Filtering Artifact Detection/Rejection Averaging Re-referencing

Page 9: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Epoching

Page 10: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Segmenting (Epoching)Segment length: at least 100 ms should precede the stimulus

onset (see baseline correction). The time - frequency analysis can distort the

signal at both ends of the segment, make sure you do not lose

important data and that the baseline segment is still long enough after

cutting off the affected portions. The affected segment length depends on the

frequency in an inverse manner (length ms ~ 2000/freq Hz)

The segment should not be too long nevertheless, the longer it is the

bigger the chance to include an artifact!

Page 11: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.
Page 12: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Epoching - SPM

Page 13: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Overview Pre-processing

Converting the data Epoching/Segmentation Filtering Artifact Detection/Rejection Averaging Re-referencing

Page 14: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Filtering Types of filters:

highpass lowpass notch (stopband filter) Butterworth (bandpass filter, backward and forward)! (require signal processing toolbox in Matlab)

Page 15: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Effects of filtering the raw dataLow

pass 3

0 H

z

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Raw

data

hig

hp

ass 0

.3 H

z

Page 16: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Filtering in SPM

Page 17: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Overview Pre-processing

Converting the data Epoching/Segmentation Filtering Artifact Detection/Rejection Averaging Re-referencing

Page 18: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Artifacts in EEG signal

BlinksEye-movementsMuscle activityEKGSkin potentialsAlpha waves

Page 19: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Eye blinks

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 20: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Eye movements

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 21: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Sweat artifacts

Quic

kTim

e™

and a

TIF

F (

Unco

mpre

ssed)

deco

mpre

ssor

are

needed t

o s

ee t

his

pic

ture

.

Page 22: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Artefact detection - SPM

Page 23: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Artifact correction

Rejecting ‘artifact’ epochs costs you data Using a simple artefact detection method will lead

to a high level of false-positive artifact detection Rejecting only trials in which artifact occurs might

bias your data Alternative methods of ‘Artifact Correction’ exist

Page 24: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Artifact correction - SPM

SPM uses a robust average procedure to weight each value according to how far away it is from the median value for that timepoint

WeightingValue

Outliers are given

less weight

Points close to median

weighted ‘1’

Page 25: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Artifact correction - SPM

Normal average

Robust Weighted Average

Page 26: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Robust averaging - SPM

Page 27: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Artifact avoidance

Blinking Avoid contact lenses Build ‘blink breaks’ into your paradigm If subject is blinking too much – tell them

EMG Ask subjects to relax, shift position, open mouth slightly

Alpha waves Ask subject to get a decent night’s sleep beforehand Have more runs of shorter length – talk to subject in between Vary ISI – alpha waves can become entrained to stimulus

Page 28: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Overview Pre-processing

Converting the data Epoching/Segmentation Filtering Artifact Detection/Rejection Averaging Re-referencing

Page 29: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Averaging

Page 30: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Averaging

S/N ratio increases as a function of the square root of the number of trials.

As a general rule, it’s always better to try to decrease sources of noise than to increase the number of trials.

Page 31: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Averaging

Page 32: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Averaging Assumes that only the EEG noise varies from trial

to trial But – amplitude and latency will vary Variable latency is usually a bigger problem than

variable amplitude

Page 33: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Averaging: effects of variance

Latency variation can be a significant problem

Page 34: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Overview Pre-processing

Converting the data Epoching/Segmentation Filtering Artifact Detection/Rejection Averaging Re-referencing

Page 35: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Re-referencing

It is important to re-reference the data in order to estimate a true, nonarbitrary zero value to which to reference the voltage measurements.

There are many different ways to re-reference, depending on the experimental question. Possibly the best solution: average reference, improves with increasing number of channelsOther option: linked mastoids, vertex, etc.

Page 36: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Re-referencing

Page 37: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Re-referencing

Page 38: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

What comes next?

Visual inspection

of individual dataGrand meanStatistical Analysis

Page 39: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

General Recommendations

Use short blocks, ca. 2 min with breaks Keep recording time under 45min Keep it small and simple Look for main effects and not for complex

interactions Don’t go fishing!

Page 40: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

References Luck, S. J. (2005). An introduction to the

event-related potential technique. Cambridge, MA: MIT Press.

Picton, T. W., Bentin, S., Berg, P., Donchin, E., Hillyard, E., Johnson, J. R., et al. (2000). Guidelines for using human event-related potentials to study cognition: Recording standards and publication criteria, Psychophysiology, 37, 127-152.

SPM Manual

Page 41: Pre-processing for EEG and MEG Przemek Tomalski & Kathrin Cohen Kadosh.

Thank you!

And many thanks to Dr. Vladimir Litvak for his advice!