Simply EEGLAB

Automated pipelines: when to use them

Station 9 · Lesson 4 · EEGLAB 2026.1

In the GUI

  1. FileManage EEGLAB extensionsToolsRun PREP pipeline eeglab
  2. PlotChannel spectra and maps
  3. ToolsRun PREP pipelinePREP pipeline control panel
  4. ReferenceReference channelsEvaluation channelsRe-referenced channelsOk [1 3:5 7:32]EOG1EOG2
  5. Line noiseLine frequencies removedOk 60
  6. Ok .html.pdfD1 prep
  7. PlotChannel spectra and maps D1 prep
  8. PlotChannel data (scroll)

Script

plugin_askinstall('PrepPipeline', 'prepPipeline', true);
EEG_raw = EEG;
eegChans = find(~ismember({EEG.chanlocs.labels}, {'EOG1', 'EOG2'}));
params = struct();
params.name = 'D1';
params.lineFrequencies = 60;
params.detrendChannels = 1:EEG.nbchan;
params.lineNoiseChannels = 1:EEG.nbchan;
params.referenceChannels = eegChans;
params.evaluationChannels = eegChans;
params.rereferencedChannels = eegChans;
[EEG, params] = prepPipeline(EEG, params);
EEG.setname = 'D1 prep';
nd = EEG.etc.noiseDetection;
if ~strcmp(nd.errors.status, 'good')
    error('PREP stopped with status: %s', nd.errors.status);
end
fprintf('PREP version: %s\n', nd.version);
fprintf('Interpolated channels: %s\n', ...
    strjoin({EEG.chanlocs(nd.interpolatedChannelNumbers).labels}, ', '));
fprintf('Still noisy after reference: %s\n', ...
    strjoin({EEG.chanlocs(nd.stillNoisyChannelNumbers).labels}, ', '));
figure; pop_spectopo(EEG_raw, 1, [], 'EEG', 'freqrange', [1 64], 'freq', [10 60]);
figure; pop_spectopo(EEG, 1, [], 'EEG', 'freqrange', [1 64], 'freq', [10 60]);
EEG = pop_eegfiltnew(EEG, 'locutoff', 0.1);
EEG.filename = ''; EEG.filepath = ''; EEG.datfile = ''; EEG.saved = 'no';
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, 0, 'setname', 'D1 prep', 'gui', 'off');
eeglab redraw;

Which value should I choose?

SettingValue in this lesson
Reference and evaluation channelsScalp channels only
Line frequencies60
Reference typerobust (the default)
Interpolationpost-reference (the default)
Keep filteredNo (the default)

For your Methods

Line noise at 60 Hz was attenuated, and robust average referencing with bad channel detection and interpolation was performed, with the PREP pipeline (prepPipeline, PrepPipeline plugin [0.57.0], EEGLAB 2026.1), using the scalp channels as reference and evaluation channels; [n] channels were interpolated.

Full lesson: https://simplyeeglab.pages.dev/en/lesson/automated-pipelines/

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

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