Simply EEGLAB
Events
Station 2 · Lesson 3 · EEGLAB 2026.1
In the GUI
- PlotChannel data (scroll)
- Event types
- EditEvent values
- latency (sec)duration (sec)
type - Cancel
Script
[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
dataFolder = 'C:\Users\me\Documents\eeg-course'; % change it
EEG = pop_loadset('filename', 'S001R03.set', 'filepath', dataFolder);
eeg_eventtypes(EEG) % T0 14, T1 8, T2 7
numel(EEG.event) % 29
{EEG.event(1:4).type} % 'T2' 'T0' 'T1' 'T0'
[EEG.event(1:4).latency] % 672 1328 2000 2656
([EEG.event(1:4).latency] - 1) / EEG.srate % 4.1937 8.2937 12.4938 16.5938
[EEG.event(1:2).duration] / EEG.srate % 4.1 4.2
pop_eegplot(EEG, 1, 1, 1);Which value should I choose?
| Field | What it stores | Stored unit | Shown in Edit > Event values as | Example (first event) |
|---|---|---|---|---|
type | Event name | text | text | T2 |
latency | When the event happened | samples | seconds | 672 (4.19 s) |
duration | How long the event lasted | samples | seconds | 656 (4.1 s) |
urevent | The event's number in the original list | number | not shown | 1 |
| Check | Expected | |||
| Event types | T0, T1, T2 | |||
| Number of events | 29: 14 T0, 8 T1, 7 T2 (the first annotation, at 0 s, is removed) | |||
| Spacing | about 4.1 to 4.2 seconds between events | |||
| Last event | T1 at about 120.4 seconds, before the end of the recording at 125 seconds |
Check
- The Events line in the main window shows
29 eeg_eventtypes(EEG)listsT014,T18 andT27- The first event in Edit > Event values is
T2at[4.1937]seconds, and the second isT0at[8.2937]seconds - The scrolling window shows event lines about every 4 seconds