EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

51
EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung

Transcript of EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Page 1: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

EEG / MEG:Experimental Design & Preprocessing

Alexandra HopkinsJennifer Jung

Page 2: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

OutlineExperimental Design

• fMRI M/EEG• Analysis

– Oscillatory activity– EP

• Design• Inferences• Limitations• Combined Measures

Preprocessing in SPM12

• Data Conversion• Montage Mapping• Epoching• Downsampling• Filtering• Artefact Removal• Referencing

Page 3: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

MEG vs. EEG

● Both EEG and MEG signals arise from direct neuronal activity

-> postsynaptic dendritic potentials● Electric field is distorted by changes in

conductivity across different layers unlike magnetic field

● High temporal resolution ~ms.

Page 4: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Sources of M/EEG signals

gyrus

sulcus

● MEG sensors only detect tangential components of fields from cortical pyramidal neurons

● Less sensitive to deeper regions

● EEG signal consists of both tangential and radial components of fields

Page 5: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.
Page 6: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Two types of MEG/EEG analysis

Event related changes(EP / ERP – ERF)

Oscillatory activity – cortical rhythms (Time-frequency analysis)

Otten, L. (2012, November 21). EEG/MEG Acquisition, Analysis and Interpretation, MSc Cognitive Neuroscience, UCL

Time locked to stimulus

Page 7: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

post-stimpre-stim

evoked response

Averaging

Event Related Changes

Repeats at same time

When response is time locked - signal averages in!

Page 8: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Evoked vs. Induced

(Hermann et al. 2004)With jitter effect - signal averages out!

Average trial by trial

Page 9: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

resting state

falling asleep

sleep

deep sleep

coma

1 sec

50 uV

ongoing rhythms

activeawake state

Oscillatory activity

Page 10: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Non-averaged data collected during continuous stimulation or task performance (or during rest) lends itself to analysis of spectral power.

• Signals can be decomposed into a sum of pure frequency components which gives information on the signal power at each frequency.

• i.e. We can do Fourier analysis and look at spectra (not-event related – break data in arbitrary segments and do some averaging

Oscillations

Page 11: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Cortical and behavioral deactivation or inhibitionClosed eyes

Alert, REM sleepAttention, and higher cognitive function

Attentional and syntactic language processesDeep sleep

Codes locations in space, navigationDeclarative/episodic memory processesSuccessful memory encoding

(8 – 12or 13 Hz)

(12 – 30 Hz)

(0 – 4 Hz)

(4 – 8 Hz)

(30 – 80 Hz)Visual awarenessBinding of informationEncoding, retention and

Page 12: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

EP vs. ERP / ERF• Evoked potential (EP)

– sensory processes– short latencies (< 100ms)– small amplitudes (< 1μV)

• Event related potential (EEG) / event related field (ERF)– higher cognitive processes– longer latencies (100 – 600ms),– higher amplitudes (10 – 100μV)

used interchangeably in general

Page 13: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Non-time locked activity(noise) lost via averaging over trials

Averaging

ERP/ ERF

Page 14: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Experimental design

• Number of trials– EP: 120 trials, 15-20% will be excluded– Oscillatory activity: 40-50 trials

• Duration of stimuli / task– Short: Averaged EP is fine– (Very) long: spectrotemporal analysis on averaged

EP or non-averaged data• Collecting Behavioral Responses

Page 15: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Inferences Not Based On Prior Knowledge

• Same ERP pattern

• Timing signals

• Distribution across scalp

• Differences in ERP across conditions and time

• Invariant patterns of neural activity from specific cognitive processes

• Timing of cognitive processes

• Degree of engagement

• Functional equivalence of underlying cognitive process

Observation Inference

Page 16: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Observed vs Latent Components

Latent componentsObserved waveform

OR

Page 17: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Design Strategies• Focus on specific, large and easily isolated

component– E.g., P3, N400, LRP, N2pc…

• Use well-studied experimental manipulations

- Similar conditions

• Component-independent experimental designs

- Very hard to study anything interesting

Luck, Ten Simple Rules for Designing and Interpreting ERP Experiments

Page 18: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

How quickly can the visual system differentiate between different classes of object?

Thorpe et al (1996)

Component-independent experimental designs

Page 19: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Avoid confounds and misinterpretations– Physical stimulus confounds

• Side effect– What you manipulated indirectly influences other things

• Vary conditions within rather than between blocks- Fatigue effect● Be cautious of behavioural confounds - Motor evoked potentials (MEPs)

Design Strategies

Page 20: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Sources of Noise in M/EEG● M/EEG activity not elicited by stimuli

– e.g. alpha waves → relaxed but alert ● Trial-to-trial variability in the ERP components - variations in neural and cognitive activity → trial by trial consistency ● Artefactual bioelectric activity - eye blinks, eye movement, cardiac and muscular activity, skin

potentials → keep electrode impedances low ● Environmental electrical activity - power lines, SQUID jumps, noisy, broken or saturated sensors →

shielding

Page 21: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Signal-to-Noise Ratio

• Size of the noise in average = (1/√N) ×R• Number of trials:

– Large component: 30– 60 per condition – Medium component: 150– 200 per condition– Small component: 400– 800 per condition– Double with children or psychiatric patients

Page 22: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Limitations• Ambiguous relation between observed ERP and latent

components

• Signal distorted en route to scalp– arguably worse in EEG than MEG (head as “spherical

conductor”)

• MEG: restrictions with magnetic implants

• Poor localization (cf. “inverse problem”)

Page 23: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Why? How?– Converging evidence, generative models– fMRI + EEG, fMRI + MEG

• Drawbacks– Signal interference– Complex experimental design

Combining Techniques

Page 24: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

OutlineExperimental Design

• fMRI M/EEG• Analysis

– Oscillatory activity– EP

• Design• Inferences• Limitations• Combined Measures

Preprocessing in SPM12

• Data Conversion• Montage Mapping• Epoching• Downsampling• Filtering• Artefact Removal• Referencing

Page 25: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

PREPROCESSING IN SPM12

• Goal: get from raw data to averaged ERP (EEG) or ERF (MEG) using SPM12

Page 26: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Conversion of data

• Convert data from its native machine-dependent format to MATLAB based SPM format

*.mat(data)

*.dat(other info)

*.bdf*.bin*.eeg

Page 27: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Define settings:

•Read data as continuous or as trials (is raw data already divided into trials?)

•Select channels

•Define file name

•‘just read’ option is a convenient way to look at all the data quickly

Data Conversion

Page 28: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• 128 channels selected• Unusually flat because

data contain very low frequencies and baseline shifts

• Viewing all channels only with a low gain

*.mat (data)

*.dat (other info)

Data Conversion - Example

Page 29: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Sampling frequency is very high at acquisition (e.g. 2048 Hz)

• Downsampling is required for efficient data storage

• Sampling rate > 2 x highest frequency in the signal of interest = The Nyquist frequency

Downsampling

Page 30: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Downsampling

Page 31: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Aliasing

Sampling below Nyquist frequency will introduce artefacts known as aliases.

Page 32: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

•Downsampling reduces the file size and speeds up the subsequent processing steps

•At least 2x low pass filter e.g. 1000 to 200 Hz.

Downsampling: SPM 12 Interface

Page 33: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Montage - representation of EEG channels • Referential montage - have a reference electrode for each

channel

• Identify vEOG and hEOG channels, remove several channels that don’t carry EEG data.

• Specify reference for remaining channels:• Single electrode reference: free from neural activity of

interest e.g. Cz• Average reference: Output of all amplifiers are summed and

averaged and the averaged signal is used as a common reference for each channel, like a virtual electrode and less biased

Montaging & Referencing

Page 34: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

RE-referencing

Page 35: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Montage & Referencing: SPM 12 Interface

Page 36: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Review channel mapping

Montage & Referencing: SPM 12 Interface

Page 37: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Cut out chunks of continuous data (= single trials, referenced to stim onset)

EEG1

EEG2

EEG3

Event 1 Event 2

Epoching

Page 38: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Specify timee.g. 100 ms prestimulus - 600 ms poststimulus = single epoch/trial

• Baseline-correction: automatic; mean of the pre-stimulus time is subtracted from the whole trial

• Padding: adds time points before and after each trial to avoid ‘edge effects’ when filtering

Epoching

Page 39: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Epoching: SPM 12 Interface

Page 40: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• M/EEG data consist of signal and noise• Noise of different frequency; filter it out• Any filter distorts at least some part of the signal

but reduces file size• Focus on signal of interest - boost signal to noise

ratio• SPM12: Butterworth filter

• High-, low-, band-pass or bandstop filter

Filtering

Page 41: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

•High-pass – filters out low-frequency noise, removes the DC offset and slow drifts in the data e.g. sweat and non-neural physiological activity

•Low-pass – remove high-frequency noise. Similar to smoothing e.g. muscle activity, neck

•Notch (band-stop) – remove artefacts limited in frequency, most commonly electrical line noise and its harmonics. Usually around 50/60Hz.

•Band-pass – focus on the frequency of interest and remove the rest. More suitable for relatively narrow frequency ranges.

Types of Filters

Page 42: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Examples of Filters

Page 43: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Bandpass Filter

Page 44: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Filtering: SPM 12 Interface

Page 45: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Artefacts

Page 46: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Removal• Visual inspection - reject trials • Automatic SPM functions:

• Thresholding (e.g. 200 μV)• 1st – bad channels, 2nd – bad trials• No change to data, just tagged

• Robust averaging: estimates weights (0-1) indicating how artefactual a trial is

EASY

Removing Artefacts

Page 47: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Robust Averaging

Page 48: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

• Use your EoG!• Regress out of your signal

• Use Independent Component Analysis (ICA)• Eyeblinks are very stereotyped and large• Usually 1st component

HARDER

Removing Artefacts

Page 49: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.
Page 50: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

Special thanks to our expertsBernadette and Vladimir Litvak

Page 51: EEG / MEG: Experimental Design & Preprocessing Alexandra Hopkins Jennifer Jung.

References• Ashburner, J. et al. (2010). SPM8 Manual. http://www.fil.ion.ucl.ac.uk/spm/ • Hansen, C.P., Kringelbach M.L., Salmelin, R. (2010) MEG: An Introduction to Methods. Oxford

University Press,• Hermann, C. et al. (2004). Cognitive functions of gammaband activity: memory match and

utilization. Trends in Cognitive Science, 8(8), 347-355.• Herrmann, C. S., Grigutsch, M., & Busch, N. A. (2005). EEG oscillations and wavelet analysis. In T.

C. Handy (Ed.), Event-related potentials: A methods handbook (pp. 229-259). Cambridge, MA: MIT Press.

• Luck, S. J. (2005). Ten simple rules for designing ERP experiments. In T. C. Handy (Ed.), Event-related potentials: a methods handbook. Cambridge, MA: MIT Press.

• Luck, S. J. (2010). Powerpoint Slides from ERP Boot Camp Lectures. http://erpinfo.org/Members/ldtien/bootcamp-lecture-pptx

• Otten, L. (2012, November 21). EEG/MEG Acquisition, Analysis and Interpretation, MSc Cognitive Neuroscience, UCL

• Otten, L. J. & Rugg, M. D. (2005). Interpreting event-related brain potentials. In T. C. Handy (Ed.), Event-related potentials: a methods handbook. Cambridge, MA: MIT Press..

• Sauseng, P., & Klimesch, W. (2008). What does phase information of oscillatory brain activity tell us about cognitive processes? [Review]. Neuroscience and Biobehavioral Reviews, 32(5), 1001-1013. doi: 10.1016/j.neubiorev.2008.03.014

• http://sccn.ucsd.edu/~jung/artifact.html• MfD slides from previous years