pre-processing pipeline

67
Pre-processing pipeline Import into EEGLAB Import event markers and channel locations Re - reference/ down - sample (if necessary) High pass filter (~.5 1 Hz) Examine raw data Reject bad channels Reject large artifact time points Collect high - density EEG data (>30 chan ) EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton Getting started

Upload: others

Post on 12-Jan-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 2: Pre-processing pipeline

Dense-array EEG

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 3: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 4: Pre-processing pipeline

EEGLAB Matlab toolbox

main graphic interface

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 5: Pre-processing pipeline

Importing a dataset

EEGLAB

supports

many

different

raw data

formats

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 6: Pre-processing pipeline

Imported EEG data

EEGLAB GUI

displays dataset

basics

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 7: Pre-processing pipeline

Load an existing dataset

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 8: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 9: Pre-processing pipeline

• Import events from Matlab array or ASCII file

• Import events from data channel

• Import from Presentation event file

• Import from Neuroscan file

72

Import data events

Often imported automatically

during data import

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 10: Pre-processing pipeline

Appearance of an event channel in raw data

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 11: Pre-processing pipeline

Imported data events

If event import was

successful,

you will see an

appropriate

number here

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

>> EEG.event

ans =

1x1303 struct array with fields:

Trial

Event_Type

type

latency

TTime

Uncertainty

Duration

Uncertainty2

ReqTime

ReqDur

init_index

init_time

urevent

duration

load

rt

Page 12: Pre-processing pipeline

Review event values

Number of

event fields

is unlimited

Insert event

BEFORE

current event

To resort: first

select Main

sorting field

Append event

AFTER

current event

Delete

CURRENT

event

Most

relevant

fields

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 13: Pre-processing pipeline

Import channel locations

Several file formats

supported (Polhemus,

BESA, El Guide …)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 14: Pre-processing pipeline

Import channel locations

EEG

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 15: Pre-processing pipeline

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 16: Pre-processing pipeline

Imported channel locations

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 17: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 18: Pre-processing pipeline

Re-reference data (if necessary/desired)

LEYE REYE

For example,

average reference

optional

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 19: Pre-processing pipeline

Re-reference data (if necessary/desired)

EEG = pop_reref( EEG, 39);

TP9 TP10

OR, re-reference to

(i.e.) 'linked mastoids'

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 20: Pre-processing pipeline

Save new dataset, keep old one

[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG,EEG, 1, 'setname',…

'Sternberg Continuous -- Reref''d'); EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 21: Pre-processing pipeline

Multiple active datasets (ALLEEG)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 22: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 23: Pre-processing pipeline

Filter the data (if necessary/desired)

High-pass

needed

for ICA

Lower cut off frequencies require longer stretches of continuous data

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 24: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 25: Pre-processing pipeline

Scroll channel data

>> pop_eegplot(EEG,1,1,1);

Alternate GUI option,

same function

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 26: Pre-processing pipeline

Scroll channel data

scaling

channels,

time,

events

sec/epoch

Scroll

buttons

Event markers

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 27: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 28: Pre-processing pipeline

Remove channel

1) Identify bad channel

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 29: Pre-processing pipeline

Remove channel(s)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 30: Pre-processing pipeline

Removing channel(s)

If not checked, will result

in dataset with one channel

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 31: Pre-processing pipeline

Channel removed

Channel data without 'F6' (see supplementary material for interpolation)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 32: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 33: Pre-processing pipeline

Reject continuous data

Equivalent

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 34: Pre-processing pipeline

Reject continuous data

Click and drag with mouse

over noisy data to reject

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 35: Pre-processing pipeline

Rejecting data for ICA

To prepare data for ICA:

Keep

Reject

... but keep stereotyped

artifacts (like eye blinks)

Reject large muscle or

otherwise strange events...

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 36: Pre-processing pipeline

Pre-processing pipeline

Import into EEGLAB Import event markers

and channel locations

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 37: Pre-processing pipeline

Independent Component Analysis

x = scalp EEG W = unmixing matrix

ICA

W-1 (scalp projections)

W*x = u

u = sources

*

x = W-1*u

Channels

Time

u = sources

Com

ponents

Time

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 38: Pre-processing pipeline

“Secrets” to a good ICA decomposition

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 39: Pre-processing pipeline

‘extended’,1

Option Default Comments

‘extended’ 0 1 is recommended to

find sub-gaussians

‘stop’ 1e-7 final weight change stop

‘lrate’ determined too small too long…

from data too large wts blow up

‘maxsteps’ 512 more channels more steps

‘pca’ 0 or Decompose only a

EEG.nbchan principal data subspace

‘stop’,1e-7 ‘lrate’,1e-3 ‘maxsteps’,750 ‘pca’,50

Runica options

Other algorithms:

binica,sobi,acsobiro

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 40: Pre-processing pipeline

Runica progress…

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 41: Pre-processing pipeline

ICA weights in EEG structure

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 42: Pre-processing pipeline

Pre-processing pipeline (review)

Re-reference/

down-sample

(if necessary)

High pass filter

(~.5 – 1 Hz) Examine raw data

Reject bad channels Reject large artifact

time points

Import into EEGLAB Import event markers

and channel locations

Collect high-density

EEG data (>30 chan)

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 43: Pre-processing pipeline

The example data: Sternberg working memory

T

RESPONSE

M L T G P Y Q W

Maintenance

(2-4 sec)

Fixation

(5 sec) Probe SOA

(1.4 sec)

Was this letter in the memorized set?

(RT)

Memorize Ignore

- +

File .../SampleData/stern.set

Data Continuous data (not epoched), ref‘d to right mastoid

Task between 3 and 7 letters to memorize (colored black),

between 1 and 5 letters to ignore (colored green),

8 letters presented during each trial

50% chance of probe letter being ‘in-set‘

See 'SternbergTaskExplanation.pdf' on wiki

for more task details.

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 44: Pre-processing pipeline

Epoch on EEG.event type

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

>> EEG = pop_epoch( EEG, {'B‘,'C‘,'D‘,...

'F‘,'G‘,'H‘,'J‘,'K‘,'L‘,'M‘,'N‘,'P‘...

'Q' 'R' 'S' 'T' 'V' 'W‘...

'X' 'Y' 'Z' }, [-1 2], 'newname',...

'Sternberg Memorize letter epochs',...

'epochinfo', 'yes');

Memorize letters: capital letters

Ignore letters: ‘g’ preceding capital letter (e.g., ‘gB’)

Probe letters: ‘r’ preceding capital letter (e.g., ‘rB’)

Page 45: Pre-processing pipeline

Extract epochs

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 46: Pre-processing pipeline

Exercise

• ALL

-Load stern.set (continuous data)

-Do not save your changes under the same filename!

• Novice

-Scroll channel data and explore plotting options under 'Settings'.

-Reject noisy time points by visual inspection

-Import standard channel locations

-Practice preprocessing steps described in this lecture

• Intermediate / Advanced (requires supplementary material)

-Remove a channel and then replace it by interpolation

-Compare this signal with the original when you do this with a

'clean' channel

-Epoch data even of interest, plot Channel ERPs from Plot menu

-Try different filter methods and cut-offs, compare results

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 47: Pre-processing pipeline

Supplementary lessons

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 48: Pre-processing pipeline

Auto-detection of noisy channels

>> EEG = pop_rejchan(EEG, 'elec',[1:71] , 'threshold',5,...

'norm', 'on', 'measure', 'prob');

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 49: Pre-processing pipeline

Auto-detected noisy channel

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 50: Pre-processing pipeline

Interpolate bad channel

Choose a channel from other dataset

Auto-select deleted

channel from other dataset

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 51: Pre-processing pipeline

Interpolated channel

Channel order changes, but scalp location is correct

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 52: Pre-processing pipeline

Merge (append) datasets

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 53: Pre-processing pipeline

Merged datasets

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 54: Pre-processing pipeline

1) input original 'type' code

2) input new 'type' code

3) Keep/delete all other events

Renaming events

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 55: Pre-processing pipeline

Renaming events

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 56: Pre-processing pipeline

Analysis of channel ERPs

>> pop_timtopo(EEG,[-200 500],[NaN],'ERP data and scalp maps'); EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 57: Pre-processing pipeline

Analysis of channel ERPs

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 58: Pre-processing pipeline

Channel ERP in rectangular array

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 59: Pre-processing pipeline

Analysis of channel ERPs

pop_topoplot(EEG,1,[0:25:275],‘Memorize',[3 4],0,'electrodes','off');

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 60: Pre-processing pipeline

Compare ERPs across conditions

How do 'Memorize' and 'Ignore' ERPs

differ?

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 61: Pre-processing pipeline

Compare ERPs across conditions

>>pop_comperp(ALLEEG,1,[2 3],[],'addavg','off','addstd','off', …

'addall','on','diffavg','off','diffstd','off','lowpass',20, …

'tplotopt',{'ydir',1});

Compare ERPs

from two conditions

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 62: Pre-processing pipeline

Compare ERPs across conditions

Click on an axis

to see larger image

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 63: Pre-processing pipeline

Analysis of ERP differences

>> pop_comperp(ALLEEG,1, 2, 3,'addavg','off',…

'addstd','off', 'diffavg','on','diffstd','off', …

'lowpass',20, 'tplotopt',{'ydir',1});

Plot difference

between two conditions

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 64: Pre-processing pipeline

Analysis of ERP differences

ERP

difference

between

2 conditions

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 65: Pre-processing pipeline

Event durations

Color denotes

event duration

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 66: Pre-processing pipeline

Comments in EEGLAB structure

>> EEG.comments

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started

Page 67: Pre-processing pipeline

Memory options

Set when loading a STUDY

EEGLAB Workshop, June 16-18, 2012, Beijing, China: Julie Onton – Getting started