BCI2000
Introduction
The contributions package for BCI2000 contains an LSL source module that can be used to acquire data from the LabStreamingLayer (LSL) to use in BCI2000. It is currently not possible to subscribe to an LSL stream from the Explore device without making changes to the source code of Explorepy or building BCI2000 yourself. This is due to the LSL node resolving streams by data type, the last released installer for BCI2000 with Contributions does not contain changes to filter by a custom property. As the LSL node filters out any type that isn’t EEG and Explorepy and Explore Desktop push the data with the type ExG, the stream cannot be discovered in this version.
This page aims to give an overview of the options advanced users have to get a data stream from the Explore device as input to BCI2000.
Option 1: Building BCI2000 locally from the latest code revision
The source code for BCI2000 is available after making a free account on the BCI2000 website. Their wiki contains an in-depth guide to building the software locally. The LSL source node available in the contributions to BCI2000 contains fields to set the LSL stream property (StreamSelectionProperty) and value (StreamSelectionPropertyValue) to filter for.
If you have built BCI2000 locally with the latest version of the LSL source node, follow these steps to stream data from your Explore device to BCI2000:
- Install Explorepy or Explore Desktop.
- If using Explorepy, use the
push2lslcommand to connect to a device and push data from it to LSL. If using Explore Desktop, connect to a device, navigate to the signal visualisation, open the LSL menu by clicking on theLSLbutton and click onPush data to LSL. - Open the BCI2000 Launcher or launch a batch script from the
batchdirectory of your BCI2000 installation that usesLSLSourceas the acquisition module. If you are using the BCI2000 Launcher, selectLSLSourceas the Signal Source module and choose the other modules as needed (for example,DummySignalProcessingandDummyApplication), then click onLaunch. - Click on
Configin the newly launched Operator to open the configuration for your set-up, navigate to theSourcetab and change the fields according to the device stream.- SourceCh: The number of channels your device has, i.e. 8, 16 or 32.
- SamplingRate: The sampling rate the device is set to, i.e. 250Hz, 500Hz, 1000Hz.
- SourceChGain: The gain for the signals, default is
auto. You can alternatively set this to 1uV per channel (i.e.1 1 1 1 1 1 1 1for an 8 channel device). - StreamSelectionProperty: The property of the stream to filter for, you can use i.e.
typeorname. - StreamSelectionPropertyValue: The value of the stream property to filter for, if using
type, this should beExG, if usingnamethis should beExplore_XXXX_ExG(withXXXXreplaced with your device’s ID).
- To ensure that your configuration is correct, click on
Set Config. This will launch a signal visualizer that will show your signals as they are coming in via the LSL stream.
Option 2: Adapting Explorepy
Explorepy and Explore Desktop push signals to LSL using the type ExG as the Explore device can be used to gather various types of biosignals. The last binary release of BCI2000 with contributions (which the LSLSource module is a part of) does not allow filtering for a specific property and value. Instead, it filters for the type EEG. To push data from the Explore device with the type EEG you can adapt the source code of Explorepy yourself. Explorepy is fully open source and can be forked from our public GitHub repository. To adapt Explorepy for your needs, you can follow these steps:
- Create a fork of Explorepy.
- Pull your newly created fork to have it locally.
- In the pulled repository, navigate to
src–>explorepyand opentools.py. - Find the method
initialize_outletsin the classLslServer. - Change the line
type='ExG'totype='EEG'where theStreamInfoobject is created for the ExG stream:
def initialize_outlets(self):
info_exg = StreamInfo(name=self.device_name + "_ExG",
type='EEG',
channel_count=self.n_chan,
nominal_srate=self.exg_fs,
channel_format='float32',
source_id=self.device_name + "_ExG")
info_exg.desc().append_child_value("manufacturer", "Mentalab")
[...]
- Create a new environment with dependencies as described in Explorepy’s documentation.
- Intead of installing explorepy in your environment from PyPI (
pip install explorepy), navigate to the root folder of your Explorepy fork and install the local repository (pip install .). - Use the
push2lslcommand to push data from the device to LSL. - From here, you can follow steps 3 - 5 from Option 1 to subscribe to the data in BCI2000 (skipping steps 4.4 and 4.5).
For more information or support, do not hesitate to get in contact at: support@mentalab.com