All Projects → merlin-neurotech → Wizardhat

merlin-neurotech / Wizardhat

Licence: other
Real-time processing and plotting of data streamed over LSL, with a focus on student-led BCI projects.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Wizardhat

candock
A time series signal analysis and classification framework
Stars: ✭ 56 (+69.7%)
Mutual labels:  eeg
CereLink
Blackrock Microsystems Cerebus Link for Neural Signal Processing
Stars: ✭ 33 (+0%)
Mutual labels:  eeg
Arl Eegmodels
This is the Army Research Laboratory (ARL) EEGModels Project: A Collection of Convolutional Neural Network (CNN) models for EEG signal classification, using Keras and Tensorflow
Stars: ✭ 422 (+1178.79%)
Mutual labels:  eeg
eeg-rsenet
Motor Imagery EEG Signal Classification Using Random Subspace Ensemble Network
Stars: ✭ 24 (-27.27%)
Mutual labels:  eeg
mnelab
MNELAB – a GUI for MNE
Stars: ✭ 147 (+345.45%)
Mutual labels:  eeg
Neurokit
NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
Stars: ✭ 264 (+700%)
Mutual labels:  eeg
BioAmp-v1.5
Upside Down Lab's Biopotential Amplifier v1.5 - Buy on Tindie at https://bit.ly/BioAmp-v1_5
Stars: ✭ 27 (-18.18%)
Mutual labels:  eeg
T Bear
Detect EEG artifacts, outliers, or anomalies using supervised machine learning.
Stars: ✭ 6 (-81.82%)
Mutual labels:  eeg
aperture
Matlab toolbox for univariate and multivariate analysis of EEG data in the time and frequency domains
Stars: ✭ 15 (-54.55%)
Mutual labels:  eeg
Neurokit.py
A Python Toolbox for Statistics and Neurophysiological Signal Processing (EEG, EDA, ECG, EMG...).
Stars: ✭ 292 (+784.85%)
Mutual labels:  eeg
cortex-v2-example
Example with Cortex V2 API
Stars: ✭ 121 (+266.67%)
Mutual labels:  eeg
EEGEdu
Interactive Brain Playground - Browser based tutorials on EEG with webbluetooth and muse
Stars: ✭ 91 (+175.76%)
Mutual labels:  eeg
Pyriemann
Python package for covariance matrices manipulation and Biosignal classification with application in Brain Computer interface
Stars: ✭ 272 (+724.24%)
Mutual labels:  eeg
Eelbrain
eelbrain.readthedocs.io
Stars: ✭ 38 (+15.15%)
Mutual labels:  eeg
Eeglearn
A set of functions for supervised feature learning/classification of mental states from EEG based on "EEG images" idea.
Stars: ✭ 469 (+1321.21%)
Mutual labels:  eeg
Neuroimaging.jl
Neuroimaging in Julia
Stars: ✭ 39 (+18.18%)
Mutual labels:  eeg
fit
Fusion ICA Toolbox (MATLAB)
Stars: ✭ 13 (-60.61%)
Mutual labels:  eeg
Microstate Eeglab Toolbox
Microstate EEGlab toolbox
Stars: ✭ 21 (-36.36%)
Mutual labels:  eeg
Fieldtrip
The MATLAB toolbox for MEG, EEG and iEEG analysis
Stars: ✭ 481 (+1357.58%)
Mutual labels:  eeg
Braindecode
Outdated, see new https://github.com/braindecode/braindecode
Stars: ✭ 284 (+760.61%)
Mutual labels:  eeg

WizardHat

logo

WizardHat is a library for handling, transforming, and visualizing EEG data streamed from consumer-grade devices over the Lab Streaming Layer (LSL) protocol. WizardHat's purpose is to enable users to easily and flexibly build brain-computer interfaces (BCIs) using a high-level API, with technical details managed in the background. Paired with ble2lsl, WizardHat currently supports streaming from the Muse (2016) brain-sensing headband and the OpenBCI Ganglion. WizardHat is easy to use and only requires three lines of code to get started.

WizardHat was built by Merlin Neurotech at Queen's University.

Note : Active Development

Our dedicated team at Merlin Neurotech is continously working to improve WizardHat and add new functionality. Current on-going projects:

  • MNE Library Compatibility
  • Implementing simple filters

Check back soon if the feature you are looking for is under development!

Getting Started

The procedure for installing WizardHat depends on whether or not you will be contributing to its development. In either case, begin by creating and activating a new Python virtual environment.

Installing for use only

Simply run

pip install wizardhat

This will automatically install the most recent release of WizardHat along with the required dependencies, including ble2lsl.

Installing for development

To set up WizardHat for development, begin by forking the repository on GitHub, then clone your fork:

git clone https://github.com/<your-github-username>/WizardHat.git

If you are also developing for ble2lsl, fork and then clone the ble2lsl repository as well, and install its dependencies:

git clone https://github.com/<your-github-username>/ble2lsl.git
cd ble2lsl
pip install -e .
cd ..

Whether or not you cloned ble2lsl, install the remaining dependencies for WizardHat:

    cd WizardHat
pip install -e .

The last command creates an editable install of WizardHat; i.e. after installation into an active virtual environment, running import wizardhat in any Python terminal/script will import the current (i.e. working) version of the modules from your fork's folder.

Finally

To ensure a bug free experience, open [your virtual env name]/lib/python3.6/site packages/pygatt/backends/bgapi/bgapi.py in a text or code editor and add:

time.sleep(0.25)

between line 200 and 201 and save the file. This ensures that the Bluetooth protocol will be given adequate time to connect to the Muse before timing out.

Now you are ready to use WizardHat!

Working with WizardHat

Our library provides two options when building, debugging, or testing your BCI code:

  1. Streaming data from Muse or other EEG device
  2. Streaming randomly generated data for testing and debugging

To begin streaming, you will need first to import ble2lsl and wizardhat.acquire into your Python workspace. The BLE device parameters for different devices are stored in respective modules in ble2lsl.devices.

import ble2lsl
from ble2lsl.devices import muse2016
from wizardhat import acquire

You then need to create a streaming outlet which establishes a Bluetooth connection with the EEG device:

streamer = ble2lsl.Streamer(muse2016)

To stream dummy data through an outlet that mimics (number of channels, sample rate, and metadata) the Muse 2016:

dummy_streamer = ble2lsl.Dummy(muse2016)

Next, to store and record the data, add the following line to capture the outlet stream:

receiver = acquire.Receiver()

Notice how you do not need to pass the outlet streamer as an argument to this function. LSL can stream over a local network, and ble2lsl doesn't need to run in the same process as wizardhat. Instead, Receiver automatically finds and connects to the LSL outlet; if multiple outlets are available, it will prompt you to choose from a list.

Now that your streamer is receiving data, you can visualize and manipulate it online. Data is streamed into structured arrays with timestamps in their first columns and channel data in their remaining columns. By default, these arrays contain the last 10 s (to the nearest sample) of streamed data, and are accessed through the streamer.buffers dictionary. For example, the structured array of most recent timestamps and samples for the Muse 2016's EEG stream (labeled "EEG") is accessed by:

streamer.buffers["EEG"].data

The available streams depend on the device, and are specified in the device's module in ble2lsl.devices. For example, the Muse 2016 headband provides the following stream types: "EEG", "accelerometer", "gyroscope", "telemetry", and "status". After each time window, data is saved to a CSV file in your directory under a folder called 'data' and is constantly updated while your stream is running. Each data buffer has an associated CSV file, accompanied by a JSON file of the same name providing metadata.

To gain a deeper understanding into how our framework operates, take a look under the hood.

Acknowledgements

This project was inspired by Alexander Barachant's muse-lsl from which some of the modules were originally based. The device specification for the OpenBCI Ganglion is largely derived from OpenBCI_Python.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].