Simply EEGLAB

Running ICA

Station 4 · Lesson 3 · EEGLAB 2026.1

In the GUI

  1. Datasets
  2. ToolsFilter the dataBasic FIR filter (new, default)
  3. Lower edge of the frequency pass band (Hz)OK 1
  4. Overwrite it in memory (set=yes; unset=create a new dataset) D1 ica1hz
  5. ToolsDecompose data by ICA
  6. ICA algorithm to use (click to select)Extended Infomax (runica.m; default) 'extended', 1
  7. Reorder components by variance (if that's not already the case)Use only channel type(s) or indicesOK
  8. Proposed rank:OK
  9. PlotComponent mapsIn 2-D
  10. Datasets
  11. EditDataset info
  12. ICA weights array or text/binary file (if any):from other datasetOK 2ALLEEG(2).icaweightsALLEEG(2).icasphereALLEEG(2).icachansind
  13. OK
  14. FileSave current dataset as

Script

EEG_main = EEG;
EEG_ica = pop_eegfiltnew(EEG_main, 'locutoff', 1);
EEG_ica.setname = 'D1 ica1hz';
expectedRank = EEG_ica.nbchan - numel(badChans) - 1;
fprintf('Expected data rank: %d\n', expectedRank);
EEG_ica = pop_runica(EEG_ica, 'icatype', 'runica', 'extended', 1);
EEG_main.icaweights  = EEG_ica.icaweights;
EEG_main.icasphere   = EEG_ica.icasphere;
EEG_main.icachansind = EEG_ica.icachansind;
EEG_main.icawinv     = [];   % recomputed by eeg_checkset
EEG_main.icaact      = [];
EEG = eeg_checkset(EEG_main);
pop_topoplot(EEG, 0, 1:20);
EEG = pop_saveset(EEG, 'filename', 'D1_main_ica.set', 'filepath', pwd);

Which value should I choose?

SettingValue
High-pass for the ICA copy1 Hz, or 2 if components stay ambiguous
AlgorithmExtended Infomax (runica)
ChannelsAll EEG channels. In D1 we keep EOG1 and EOG2
Number of componentsEqual to the data rank: 31 in D1 after average reference

Check

  • In the main EEGLAB window
  • In the command window
  • Open the component maps
  • Reload the saved file
  • The rank matches

For your Methods

Independent component analysis (extended Infomax; Lee et al., 1999) was computed with runica ([31] components after PCA reduction to the data rank) on a copy of the data high-pass filtered at 1 Hz, and the resulting weights were applied to the 0.1 Hz high-pass filtered data.

Full lesson: https://simplyeeglab.pages.dev/en/lesson/run-ica/

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

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