Simply EEGLAB

Organizing files & storage

Station 9 · Lesson 5 · EEGLAB 2026.1

In the GUI

  1. FileSave current dataset asEditDataset infoDataset name
  2. FileBIDS toolsBIDS export wizard (from raw EEG to BIDS)
  3. FileBIDS toolsExport STUDY to BIDS folder
  4. FileBIDS toolsValidate BIDS dataset

Script

[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
eeglabRoot = fileparts(which('eeglab'));
projectRoot = pwd;   % run from inside faces_project
bidsRoot    = fullfile(projectRoot, 'rawdata');            % ds002718 lives here
derivRoot   = fullfile(projectRoot, 'derivatives', 'eeglab');
folders = {bidsRoot, derivRoot, fullfile(projectRoot, 'code'), ...
           fullfile(projectRoot, 'figures'), fullfile(projectRoot, 'logs')};
for k = 1:numel(folders)
    if ~exist(folders{k}, 'dir'), mkdir(folders{k}); end
end
rawFiles  = dir(fullfile(bidsRoot, 'sub-*', 'eeg', '*_eeg.set'));
rawGB     = sum([rawFiles.bytes]) / 1e9;
nSubjects = numel(rawFiles);
fprintf('%d subject(s) on disk, %.2f GB of raw data\n', nSubjects, rawGB);
nSavedStages = 2;   % clean continuous + epochs
fprintf('Derivatives for these subjects: up to about %.1f GB\n', rawGB * nSavedStages);
fprintf('Full dataset (18 subjects): about %.1f GB raw\n', 18 * rawGB / max(nSubjects, 1));
subj   = 'sub-002';
stage  = 'clean';
outDir = fullfile(derivRoot, subj, 'eeg');
if ~exist(outDir, 'dir'), mkdir(outDir); end
outName = sprintf('%s_task-FaceRecognition_desc-%s_eeg.set', subj, stage);
fprintf('Save stage "%s" as %s\n', stage, fullfile(outDir, outName));
data = struct('file', {fullfile(eeglabRoot, 'sample_data', 'eeglab_data.set')});
bids_export(data, 'targetdir', fullfile(projectRoot, 'd1_bids'), ...
    'tInfo', struct('TaskName', 'attention', 'PowerLineFrequency', 60));

Which value should I choose?

DecisionChoice in this lesson
Location of raw datarawdata, read only
Location of resultsderivatives/eeglab/sub-XXX/eeg
Number of saved stagesTwo: the clean continuous version, then the epochs
Saved separatelyICA weights, bad channels, removed components
One or two files per datasetTwo files, .set and .fdt (the EEGLAB 2026.1 default)
Number formatsingle (EEGLAB default)

Full lesson: https://simplyeeglab.pages.dev/en/lesson/file-organization/

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

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