Simply EEGLAB

Events

Station 2 · Lesson 3 · EEGLAB 2026.1

In the GUI

  1. PlotChannel data (scroll)
  2. Event types
  3. EditEvent values
  4. latency (sec)duration (sec) type
  5. 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?

FieldWhat it storesStored unitShown in Edit > Event values asExample (first event)
typeEvent nametexttextT2
latencyWhen the event happenedsamplesseconds672 (4.19 s)
durationHow long the event lastedsamplesseconds656 (4.1 s)
ureventThe event's number in the original listnumbernot shown1
CheckExpected
Event typesT0, T1, T2
Number of events29: 14 T0, 8 T1, 7 T2 (the first annotation, at 0 s, is removed)
Spacingabout 4.1 to 4.2 seconds between events
Last eventT1 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) lists T0 14, T1 8 and T2 7
  • The first event in Edit > Event values is T2 at [4.1937] seconds, and the second is T0 at [8.2937] seconds
  • The scrolling window shows event lines about every 4 seconds

Full lesson: https://simplyeeglab.pages.dev/en/lesson/events/

Content license: CC BY-NC-SA 4.0 · MIT (code)

An independent learning site, not affiliated with EEGLAB or SCCN.