In short

As in the EEGLAB software structure, for any new functionality, you need to write two functions, a signal processing function (sample) and a graphic interface for this function (sample). Then, send them to us as mail attachments.

How to contribute to the EEGLAB project

1 - You must first remember that EEGLAB is disbuted under a GPL GNU licence, which implies that the software sources can not be used for commercial purposes. The functions you may develop for the EEGLAB project can only be used through free-softwares.

2 - You will keep all the credit for your functions. As in the help pages of the ICA toolbox pages and EEGLAB software, the contributors are indicated at the bottom.

3 - You can use the functions you have already developed. Including a new functionnality to EEGLAB means to program at least two functions. The first function can be of any format. The second function is a graphical interface of the first function that uses the main structure EEG of the EEGLAB software.

4 - The functions you send will first be included in a 'Contribution' directory and not in a standard menu. The reason is that we want the software to remain stable. If a new function corrupt the EEGLAB environment, then other researcher may start claiming that the EEGLAB software is not stable and may stop using it. Including new functionnalities to the 'Contribution' directory will ensure stability for users that don't use the functions in this directory. As a second step, if a function proves to be stable, it will be integrated into the main menus.

Direction of how to write new functions for EEGLAB

As indicated, for any new functionnality you will need two functions

1 - The signal-processing function

For this function, you only need to comply with the documentation syntax, so that the header can be converted into an HTML page. We propose this sample header: Below is the disclaimer you may include into the header of the function.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

2 - The pop_function associated with the signal processing function

This function is the graphical interface to the signal-processing function. It must include the same disclaimer as the signal processing function and

1 - It must take the EEG structure as a first input, used by the software EEGLAB. The second parameter may specify wether the signal processing function will be applied to the ICA activity or to the raw EEG data.

2 - Additional parameters must be optional. If they are not provided, a window must pop-up to ask for their values.

3 - The function must return a 'string' containing the call to the current function. When the string is evaluated with the function 'eval', it must perform the same processing the function have just performed. This string will be stacked up into the EEGLAB history.

4 - As a convention, if the function is drawing a graph, the call of the function without enough arguments pops up a new figure. However, with enough arguments (macro call), the function directly draw in the current figure (thus allowing the user to build big panneled figures with 'subplot' commands).

Writing this pop_function is very easy and can usually be done in a few minutes if you just modify this pop_sample function.

Then email us the functions as attachement and we will put them in the contribution menu of EEGLAB.