Developing BCI applications
Besides interacting with the NIC software we have prepared different tools that allows you accessing to Enobio generated data. We describe them in the following sections. However if you are developping Multimedia applications, particularly audio and sonifications ones, please take a look at our interfaces with Pure Data, and Processing through NE Feature Extractor, and BrainPolyphony software tools.
What is BCI2000?
A Brain-Computer Interface (BCI) provides a new communication channel between the brain and a computer. Mental activity leads to changes of electrophysiological signals like the electroencephalogram (EEG). BCI systems interpret and detect these changes transforming them into commands that are sent to a computer or any other device to be controlled. BCI2000 is a general-purpose widely used system for BCI research. It can also be used for data acquisition, stimulus presentation, and brain monitoring applications.
BCI2000 consists of four modules:
-Signal Source: In charge of interfacing the device that handles the EEG acquisition.
-Signal Processing: Processing of the digitalized acquired signal
-Application: User feedback and interface to the operator
-Others: Other modules whose functionalities are not included above.
These four modules can be started using the script (batch) files that can be found in the ‘batch’ directory. Alternatively, there is a BCI2000Launcher program that allows to manage BCI2000 module startup using a graphical user interface. BCI2000 also facilitates interactions with other software. For example, Matlab scripts can be executed in real-time from within BCI2000. Furthermore, a simple network-based interface allows for interactions with external programs written in any programming language.
BCI2000 is provided with full source code and all executables, which run on most current PCs running Microsoft Windows. It is provided the complete source code to the BCI2000 system. Compilation supports Borland C++ Builder 6.0 or Borland/CodeGear Development Studio 2007/2009 (all BCI2000 versions), VisualStudio, and MinGW (BCI2000 V3.0).
BCI2000 is available through the GPL. The use of BCI2000 is free for academic and research institutions. No restrictions on how you may use the BCI2000 system exist, e.g., whether or not you share your software additions or your research results
BCI2000 can be downloaded here. Only registration is needed.
Comprehensive documentation on the BCI2000 system can be found on the BCI2000 Wiki.
Enobio/StarStim BCI2000 Integration
Enobio and BCI2000
BCI2000 supports a variety of data acquisition systems, including Enobio in its 8 channels version as well as StarStim. Enobio and StarStim is a wearable, modular and wireless electrophysiology sensor systems for capture of:
- EEG (Electroencephalogram - brain activity)
- ECG (Electrocardiogram - heart activity)
- EOG (Electrooculogram - eye movement)
ADC module for Enobio can be found here.
More information about this module can be found here
To install the Enobio sensor just copy in the prog folder:
When launching BCI2000Launcher for the first time usually ENOBIO3G is included as ‘Others’ module. Right click on ENOBIO3G and select ‘to Signal Generator’ to mark it as an EEG acquisition device.
Enobio/StarStim Configuration Parameters
-SourceCh: Indicates the number of Enobio channels that have been acquired. Maximum value is 8.
-SampleBlockSize: Number of samples transmitted at a time
-SamplingRate: Number of samples per second recorded for each channel. Fixed value to 500.
-SourceChOffset: Default offset of every channel. Should be set to 0.
-SourceChGain: Gain for each channel to adjust the measurement to microVolts. This value shall be set to 0.001.
-ChannelNames: list of channel names
-BluetoothMac: Enobio device Bluetooth MAC address 00:07:80:XX:XX:XX (look at the back of the Enobio device)
-EEGChList: List of physical channel indices of the EEG channels in use.
-TriggerChList: List of one-bit trigger channels to append to the end or a single 0 to acquire all trigger channels as a single 16-bit channel.
-NotchFilter: Filter to remove the influence of the power line noise. Set to 50Hz in Europe or 60Hz in America.
-HighPassFilter: Filter to remove the signal drift and low frequencies influence.
-LowPassFilter: Filter to remove the high frequencies influence.
-AllignChannels: Bit indicating if channels shall be aligned in time. As default set as true (1).
-SourceChTimeOffset: Fixed delay of the incoming signal. Empty as default.
-TransmitChList: List of the channels to take part in the preprocessing stage.
BCI2000Launcher allows to graphically configuring your BCI2000 application. The BCI2000Launcher program provides a convenient user interface for organizing BCI2000 applications and parameter files. SignalSource, SignalProcessing, and Application modules are selected from a list as well as parameters files.
BCI2000 Operator Module
Once BCI2000 modules have been selected using BCI2000Launcher or the corresponding batch file BCI2000 Operator Module allows to view and edit system parameters. It also gives the possibility to save and load parameter files, and start and stop system operation.. The main window contains four buttons:
- Config: Opens a configuration windows allowing to parameterize the selected modules (Including Enobio).
-SetConfig: Applies the current set of parameters to the system
-Start: Atarts system operation
-Quit: Exits the system once the experiment has finished.
BCI2000 Enobio/StarStim Mu Rhythm Example
The application user interface presents a vertical bar on the right that can be on the top or the bottom. The user has move a ball appearing from the left upwards or downwards depending on the vertical bar position. Imaginary movements of both hands should make the ball go up. Imaginary movements of both feet should make the ball go down.
It requires some practice to correctly make the imaginary movements. In general for the feet movement, people usually imagine themselves walking barefoot on the beach, feeling the sand on their feet and toes. Regarding the hand movement, people use to imagine themselves touching something soft.
Place the ENOBIO with the reference (CMS and DRL) in the right mastoid. Enobio channels shall be connected as shown below.
Channel 1: F3
Channel 2: F4
Channel 3: T7
Mu Rhythm Batch File
The batch file corresponding to the Mu-Rhythm demo ‘CursorTask_Enobio3G.bat’ can be found here. To start the demo just run the batch file.
- Press 'Config' then in the Operator Modulo and then 'Load Parameters'.
- Select 'ENOBIO_8ch.prm' parameter you can find here.
- Make sure the MAC address in the 'Source tab' is the same as the one of the ENOBIO you are using.
- Press close to return to the Operator Module.
- Press 'Set Config'
- Press 'Start' and you are ready to go!
- You can modify a lot of parameter in the 'Application' tab if you wish more trials, different colors, different timings, etc...
- In the 'Filtering' tab, you can select the different spatial filter configuration, the features to use and also the classification settings.
- There is a initial mu rhythm session that can be done to personalize the BCI2000 demo. Follow the tutorial!
Enobio/Starstim has been integrated with OpenVIBE. OpenViBE is a software platform dedicated to designing, testing and using brain-computer interfaces. It can be used to acquire, filter, process, classify and visualize brain signals in real time.
You can download it HERE. Read the readme.txt file in the release folder to compile Starlab's Enobio Driver integrated to OpenVibe. It has been tested in Windows XP.
Enobio/Starstim has been integrated with PureData, a real-time graphical programming environment for audio, video, and graphical processing.
Pure Data (aka Pd) is an open source visual programming language. Pd enables musicians, visual artists, performers, researchers, and developers to create software graphically, without writing lines of code. Pd is used to process and generate sound, video, 2D/3D graphics, and interface sensors, input devices, and MIDI.
PD has more powerful sound synthesis and computer music capabilities than Processing, but is not as strong on Interactivity and visualisation.
PD-TCP+PlotEnobioFile20ch This PD patch provides an interface to the 20 channel Enobio 2 wireless EEG system. The patch reads data from a textfile containing a recording of an EEG experiment. The patch also reads data streaming live from a TCP socket. Develop your sonification / musicification using the recorded data file as a tested, and then try a live data stream when it is ready. This patch provides:
This patch provides:
- capability to read a 20ch Enobio EEG file
- capability to read a live streaming EEG data from a TCP socket.
- a visualisation of the data
- Note that there is no sonification - thats your job.
- Download and install PD - http://puredata.info
- Download and install PD-TCP+PlotEnobioFile20ch - https://dl.dropboxusercontent.com/u/5965581/PD-TCP%2BPlotEnobioFile20ch.zip
- Download an EEG file and put it in the PD-TCP+PlotEnobioFile20ch folder. - https://dl.dropboxusercontent.com/u/5965581/20130225164604_Patient1.easy
- Here is another EEG data set where the subject was looking at images flashing by at 3Hz - https://dl.dropboxusercontent.com/u/5965581/20130225164604_Patient1.easy
Enobio/Starstim has been integrated with Processing, an open source programming framework for people who want to develop multimedia applications.
SonifyNoiseBandsFromEnobioFile20Ch is an interface to a sonification of the Enobio EEG. Press "s" to see the spectrum, "t" to see the time domain waveform. Hover over a channel to hear a sonification of the average power in each band which varies the amplitude of octave filtered noise.
This sketch :
- reads data from a recording of EEG data that has been saved to a file in the /data subdirectory
- demonstrates the use of the spectral functions in Minim to filter the signal into bands
- demonstrates the use of the Noise and band pass Filter Ugens in Minim
- provides an interactive visualisation of power in EEG bands
- provides a simple example of a functional sonification of EEG
To set up and install :
- Download and install Processing - http://processing.org
- Download and install Minim 2.1.0 BETA (new UGEN Framework) - http://code.compartmental.net/tools/minim/
- Download and install SonifyNoiseBandsFromEnobioFile20Ch - https://www.dropbox.com/s/12lfkehrkoka57f/sonifyNoisebandsFromEnobioFile20Ch.zip
- Download a recorded EEG file and put it in the SonifyNoiseBandsFromEnobioFile20Ch/data subdirectory - https://dl.dropboxusercontent.com/u/5965581/20130225164604_Patient1.easy
- Here is another EEG data set where the subject was looking at flashing images at 3Hz - https://dl.dropboxusercontent.com/u/5965581/20130225164604_Patient1.easy
- Start Processsing and load SonifyNoiseBandsFromEnobioFile20Ch.pde
- Press the arrow button
LIVE STREAMING VERSION Here is an updated version that reads the data streaming live from an Enobio on someones head. You will need to edit the TCP address for your connection. https://dl.dropboxusercontent.com/u/5965581/sonifyNoisebandsFromEnobioTCPIP20Ch.zip