Jump to content

User Tutorial:BCI2000 Tour

From BCI2000 Wiki

This page is intended to get you started, and make you comfortable using BCI2000. It shows you how to use BCI2000 in a simulation mode, without the need of brain signal data acquisition hardware. Additionally, you will be introduced to some of the most important modules and tools available for use.

Starting up BCI2000

BCI2000 consists of four executables (modules) which need to be started up in a certain order. This can be done using the script (batch) files in the batch directory. Alternatively, there is a BCI2000Launcher program that allows you to manage BCI2000 module startup from a graphical user interface.

We will begin the BCI2000 tour by double-clicking the file batch/CursorTask_SignalGenerator.bat. This will launch the modules required for a simulation of a Mu rhythm BCI session.

BCI2000 Help

When the main operator window appears, choose BCI2000 Help from the Help menu. The operator module's help page will be opened in a web browser window. On the left side of the help page, a navigation menu provides access to available BCI2000 documentation.

The BCI2000 help is a local copy of the BCI2000 online documentation wiki, providing a snapshot that corresponds to your version of the BCI2000 executables.

Loading a Parameter File

BCI2000 configuration is stored in parameter files. Before performing an experiment, you will typically load a parameter file that contains subject-specific as well as general configuration information.

In the main operator window, click the Config button. A configuration window appears. There, click the Load Parameters button, which will open up a file chooser dialog. Open parms/mu_tutorial/MuFeedback.prm.

Entering a Subject ID

BCI2000 stores data files in directories with names that are constructed from subject ID and session number.

In the configuration dialog, go to the Storage tab, and identify the DataDirectory parameter. This parameter determines the path to the top level data directory, i.e. the directory below which session directories will be created. By default, this parameter is set to ../data, a relative path that points to your BCI2000 installation's data directory.

Go to the SubjectName parameter, and enter an ID such as TEST, or your own initials.

Parameter Help

There is a "Help" button on the right side of the configuration window. Click that button, and observe that the mouse cursor turns into a question mark. Move the mouse cursor over the SubjectName parameter label, and press the left mouse button.

A web browser window will open up, and display a help page describing the SubjectName parameter.

Applying Configuration Parameters

Close the configuration dialog by using its close button (the button labeled "X" located on the top right corner of the window). This will accept your parameter changes (there is no "Cancel" option).

In the main operator window, click Set Config. This will prompt the operator module to send configuration parameters to the remaining BCI2000 modules, which will perform some sanity checks on them, configure themselves accordingly, and report back to the operator module.

Once you clicked the Set Config button, a signal source window will appear, displaying a simulated EEG. Initially, this window is rather small, displayed in the upper left corner of the screen. Resize and move it to your liking -- its size and position will be preserved across BCI2000 sessions.

In a real BCI session, you will use this window to assess signal quality. In this simulation session, when moving the mouse, you should notice a change in the simulated EEG signal. This is the signal that will later control the feedback cursor.

Right-clicking the EEG window will bring up a context menu with display options such as increasing/decreasing the number of channels displayed, choosing display colors, applying filters to the signal. (Details are described on the Operator Module's reference page.)

Performing a Session

Once Set Config has been clicked, the Start button will be active. Click it to start a simulated feedback session. During the session, you will see a cursor moving from the left to the right by itself, and one of two targets highlighted on the right. Your task will be to move the cursor up or down, such that it hits the highlighted target. In simulation mode, you can move the feedback cursor by moving the mouse cursor up and down.

The period during which the cursor moves from left to right is called a Trial. During operation, a number of trials will follow each other, making up a Run. After a few minutes, BCI2000 will stop operation by itself, and the Start button will change to Resume. This means that a run has been finished, and the corresponding data file has been closed. Clicking Resume each time, you may add as many runs to the current Session as you like. All runs belonging to a session will be stored in that session's data directory.

BCI2000 contains a component that adapts itself to the brain signal's mean value and its amount of variation. This component needs to observe the signal for a while before it can operate properly. This means that initially you will not feel a correspondence between your actions and the cursor; just stick with it for a few trials, and you will note how control gets more accurate over time. Also, it is important that you place the mouse cursor in a center position at the beginning of each trial, to give you enough space to move into the required direction. Likewise, when a real subject controls the cursor using brain signals, cursor control will only be possible after blindly following instructions for some trials.

When you have acquired one or more runs, you may quit BCI2000.

Opening Data Files in BCI2000Viewer

Use the Windows Explorer to display the contents of data/<SubjectName>001, which is the session directory corresponding to your recorded session (in place of <SubjectName>, enter the ID that you used for the SubjectName parameter). In the session directory, single runs correspond to .dat files carrying the session's name, appended with a run number.

To view the content of a data file, open it in the BCI2000Viewer program provided in tools/BCI2000Viewer. It is recommendable that you double-click the .dat file in question, and then use "Choose application" to permanently associate BCI2000Viewer with the .dat extension.

Alternatively, drag a .dat file onto the BCI2000Viewer icon, a link thereto, or BCI2000Viewer's application window to display the file's contents.

Viewing State Information

Once you opened a file in BCI2000Viewer, check the "TargetCode", "ResultCode", and "Feedback" checkboxes displayed in the top right corner of its application window.

Above the signal, values of these so-called state variables will be displayed. Whenever TargetCode changes from 0, a target has been displayed during the recording. Whenever ResultCode changes from 0, a target has been hit by the cursor. A Feedback value of 1 indicates that the feedback cursor was visible. In data analysis, this state information allows to determine trial structure and data labels.

Help on state variables is available as well. Right-click the "TargetCode" entry in the top right corner of the BCI2000Viewer window, and choose Help on the "TargetCode" state variable from the context menu. A browser window will open up, and display a help page describing the TargetCode state variable.

Viewing Parameters using BCI2000FileInfo

Each data file contains the full set of parameters and their values at the beginning of the recording. You may view those parameters, and save them to a parameter file, in original or modified form, using the BCI2000FileInfo program located at tools/BCI2000FileInfo.

To open a .dat file in BCI2000FileInfo, drag-and-drop it onto the program symbol, or into the program's main window. Then, click "Show Parameters"; this will open a parameter configuration dialog as you know from the operator module.

Stimulus Presentation

In addition to the cursor feedback paradigm, BCI2000 comes with a multi-purpose Stimulus Presentation module. This module has many of the features of dedicated programs like Presentation or e-Prime. In the context of BCI research, the BCI2000 StimulusPresentation module is often used for an initial Mu rhythm session, and its timing precision allows ERP experiments as well. In addition, it can be used in conjunction with the P3SignalProcessing module (which can average and classify ERPs) to provide real-time feedback to evoked potentials.

To try the stimulus presentation module, start BCI2000 using the batch/StimulusPresentation_SignalGenerator.bat. Then, click Config, and load the configuration file at parms/examples/StimulusPresentation_SignalGenerator.prm. Go to the Storage tab, and enter a subject ID into the SubjectName parameter. Run the experiment clicking Set Config and Start. (Note: The goal here is simply to introduce you to the stimulus presentation module. You will not be able to affect the visual stimulus presentation.)

Locate the resulting data file at data/<SubjectName>001/<SubjectName>S001R01.dat, and open it using BCI2000FileViewer, as you did earlier in this tour. In BCI2000FileViewer's main window, check the StimulusCode checkbox to display the StimulusCode state variable. During presentation of a stimulus, the StimulusCode state is set to a ordinal number corresponding to the stimulus; in data analysis, this information may then be used to segment data into epochs, and to group epochs according to stimuli.

P300 Speller

As part of its core distribution, BCI2000 comes with a P300 Speller module. The P300 Speller module implements a BCI that uses evoked responses to select items from a rectangular matrix, as it was originally described by Farwell and Donchin (1988).

To calibrate the P300 Speller for an individual subject, it is operated in a "copy spelling" mode, prompting the user to concentrate on pre-defined letters in sequence. Start batch/P3Speller_SignalGenerator.bat, click Config, and load parms/examples/P3Speller_CopySpelling.prm. Close the configuration window, then click Set Config and Start to view copy spelling in action.

In simulation mode, the simulated EEG will simulate evoked responses on the respective items, allowing to test signal classification and spelling functionality. Therefore, spelled letters will correspond to predefined letters when using the simulated EEG source module.

Once calibrated, the purpose of the P300 Speller is to choose arbitrary letters from the matrix, i.e. "free spelling" without a pre-defined letter sequence. Also, the speller is able to switch between multiple matrices.

To do a "free spelling" demo with multiple menus, click Config, and load parms/examples/P3Speller_Menus.prm. Then close the configuration window, click Set Config, and Start. In simulation mode, selecting a matrix element is achieved by clicking it with the mouse. Actual P300 classification is done averaging over a fixed number of epochs, so clicking an item will not immediately select it. Rather, mouse selection will override classification after the number of epochs is reached, which takes a few seconds.

Where to go from here

In this tour, you have acquired some experience how to operate BCI2000 and how to view information contained in data files. Additionally, you have seen the software elements available to build sensorimotor rhythm and evoked response BCIs.

When you are an experimenter, you might want to do one of the tutorials that introduce you to actual EEG experiments:

When you would like to adapt BCI2000 to your own amplifier, you might be interested in a tutorial on Implementing a Data Acquisition Module.

If you want to apply your own signal processing to brain signals, see

For other BCI2000 resources that support you in rapid development of data acquisition, signal processing, or user application modules, see Rapid Development.

All documentation is accessible through a hierarchy of content pages, starting at the Main Page.

See also

User Reference:Contents, Technical Reference:Contents, Programming Reference:Contents