Simply EEGLAB

ICLabel & removing components

Station 4 · Lesson 5 · EEGLAB 2026.1

In the GUI

  1. ToolsClassify components using ICLabelLabel components
  2. Select which icversion of ICLabel to use:Default (recommended)OK
  3. ToolsClassify components using ICLabelFlag components as artifacts
  4. Select range for flagging component for rejectionMinMaxMuscleEye
  5. OK
  6. ToolsRemove components from data
  7. Manual rej.YesYes
  8. List of component(s) to remove from dataOK
  9. Plot single trials
  10. Accept
  11. FileSave current dataset asOverwrite it in memory (set=yes; unset=create a new dataset) D1 main cleanD1_main_clean.set

Script

EEG = pop_iclabel(EEG, 'default');
classes = EEG.etc.ic_classification.ICLabel.classes;
probs   = EEG.etc.ic_classification.ICLabel.classifications;
disp(classes);
disp(round(probs(1:10, :) * 100));
thresh = [NaN NaN; 0.9 1; 0.9 1; NaN NaN; NaN NaN; NaN NaN; NaN NaN];
EEG = pop_icflag(EEG, thresh);
artifactComps = find(EEG.reject.gcompreject);
addpath(fullfile(fileparts(which('iclabel')), 'viewprops'));
if ~isempty(artifactComps)
    pop_viewprops(EEG, 0, artifactComps);
end
if ~isempty(artifactComps)
    EEG = pop_subcomp(EEG, artifactComps, 0);
end
EEG.setname = 'D1 main clean';
EEG = pop_saveset(EEG, 'filename', 'D1_main_clean.set', 'filepath', pwd);
EEG = pop_eegfiltnew(EEG, 'hicutoff', 30);
EEG.setname = 'D1 main clean lp30';
EEG = pop_saveset(EEG, 'filename', 'D1_main_clean_lp30.set', 'filepath', pwd);

Which value should I choose?

SettingValue
Classifier versionDefault
Flagging thresholdEye and Muscle above 90%
Other classes (Heart, Line Noise, Channel Noise)Not flagged automatically
ICLabel version1.6 or newer

Check

  • Compare the signal
  • Count the components
  • Open the component maps

For your Methods

Components were classified with ICLabel (version 1.7; Pion-Tonachini et al., 2019), and components with a probability above 0.9 for the Eye or Muscle class were reviewed visually and removed ([N] components). Data were then low-pass filtered (passband edge 30 Hz, cutoff frequency [33.64] Hz at −6 dB, filter length [59] points; pop_eegfiltnew, firfilt plugin 2.8).

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

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

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