Simply EEGLAB

Rejecting bad epochs

Station 5 · Lesson 3 · EEGLAB 2026.1

In the GUI

  1. Datasets Marked 1 of 80 epochsD1 epochs cleanD1_epochs_clean.set
  2. DatasetsFileSave current dataset as D1 epochs blD1_epochs_bl.set
  3. FilePreferencesIf set, show all menu items from previous EEGLAB versions. You must restart EEGLAB for this to take effect.Ok
  4. FileLoad existing dataset eeglab
  5. ToolsReject data epochsReject extreme values
  6. Rejection abnormal elec. values -- pop_eegthresh()Electrode (indices(s), Ex: 2 4 5): 1:32
  7. Minimum rejection threshold(s) (uV, Ex:-20 -10 -15): -100-10
  8. Maximum rejection threshold(s) (uV, Ex: 20 10 15): 10010
  9. Start time limit(s) (seconds, Ex -0.1 0.3):End time limit(s) (seconds, Ex 0.2):
  10. Reject marked trial(s)Ok
  11. REJECTYES
  12. Name it:Ok D1 epochs clean
  13. FileSave current dataset as D1_epochs_clean.set

Script

EEG = pop_eegthresh(EEG, 1, 1:EEG.nbchan, -100, 100, EEG.xmin, EEG.xmax, 0, 0);
badEpochs = find(EEG.reject.rejthresh);
fprintf('Marked %d of %d epochs\n', numel(badEpochs), EEG.trials);
if ~isempty(badEpochs)
    EEG = pop_rejepoch(EEG, EEG.reject.rejthresh, 0);
end
EEG.setname = 'D1 epochs clean';
EEG = eeg_checkset(EEG);
EEG = pop_saveset(EEG, 'filename', 'D1_epochs_clean.set', 'filepath', pwd);
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG);
eeglab redraw

Which value should I choose?

SettingValue
Amplitude threshold after ICA cleaning±100 µV
A strict threshold±50 µV or less
ChannelsAll channels, including EOG
Time windowThe whole epoch
Minimum number of trialsNo general number

For your Methods

Epochs in which the voltage at any channel exceeded ±100 µV were rejected (pop_eegthresh, EEGLAB 2026.1), leaving [N] of 80 epochs.

Full lesson: https://simplyeeglab.pages.dev/en/lesson/epoch-rejection/

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

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