User Tools

Site Tools



EEGLAB Hackathon
Main Website


This is an old revision of the document!

Getting cosy with EEGLAB: Batch Crews

1. Basic programming tips & loops

As we said earlier, the ultimate goal is to be able to automatise the processing pipeline. Imagine having to go through 20 participants manually and waiting for each steps to be processed to carry on, in the case of long steps like ICA, it would probably take you days to just pre-process your data. We will therefore want to write our own batch scripts to automatise some of the processes.

EEG/ERPLab commands

  • All functions corresponding to EEGLAB menus are listed here and all EEGLAB functions even those not currently attached to a GUI menu can be found here.
  • Every menu window should have the name of the function it will call, which makes it easy to know which function to call when scripting.
  • Just like with any function MATLAB will have a help file stored which gives helpful details about each function and the arguments that it requires. For example, if you typed help pop_loadset(), MATLAB would display a help text file which would tell you that the function needs a the name of a file and its path. The function would then take the following shape: EEG = pop_loadset('filename', 'S1.set');
  • Recently, EEGLAB has implemented a function to export the history of your processing session to a *.mat file. This means that for all the steps we have done so far we actually can retrieve the command line that was ran. It's not perfect, but it's a great help to quickly script stepts and customise them.
  • For example, when we loaded the *.cnt file at the beginning of our session, the menu called the function pop_loadcnt() and the function took the following form:
EEG = pop_loadcnt('/Users/pss059/Desktop/LabelsData/526.cnt' , 'dataformat', 'auto', 'memmapfile', '');

What this basically does is assign a loaded dataset into an object called EEG. EEG refers to the current dataset loaded in memory. It is a convention of EEGLAB.

Loops & hoops

The level of programming that batching requires doesn't really go much further than creating loops. Which once you've seen one you know them all.

The basic idea of a loop is to loop through a certain number of operations for a certain number of times and goes through the following logic:

  1. Declare the variable you want to loop over var=value
  2. Explain how you are looping through the variable
    1. A common one is to go through each element of the variable for length(var)
  3. List operations to be performed e.g., a=rand()
  4. end loop

Here are a few basic loops: write loops later */

DISCLAIMER: The tutorials provided on this wiki are not intended to compete with the tutorials written by the EEGLAB's (and other toolboxes) developers (EEGLAB website). It intends to be a condensed version for educational/reference purposes for members of the lab/department to which this workshop was given.

eeglabsessh1b.1391599303.txt.gz · Last modified: 2014/10/08 03:14 (external edit)