Skip to main content

Software to stream EEG data, perform preprocessing, and train machine learning models to build real-time BCI applications.

Project description

OpenCortex

OpenCortex is a fully-featured EEG streamer that includes a classifier and a GUI to visualize the data in real-time.
Via the LabStreamingLayer (LSL) protocol, it can receive and send data to any compatible device or software and be used to build real-time neural applications (BCI, neurofeedback, etc.).

OpenCortex StreamerGUI

Features

  • GUI to plot EEG in real-time
  • Signal real-time filtering (bandpass, notch)
  • Signal quality estimators
  • Save custom markers on the data
  • Inlet stream to mark the data with external triggers
  • Outlet stream that can send raw EEG to an external receiver
  • General-purpose classifier interface that can be initialized with any model from Scikit-Learn
  • Cross-validation plots with ROC curve and Confusion Matrix

Table of Contents

Supported Devices

Getting Started

These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

List any software or dependencies that need to be installed before setting up the project.

# Example: 
# Python 3
sudo apt-get install python3

Installation

  1. Clone the repository
git clone https://github.com/BRomans/OpenCortex.git
cd OpenCortex
  1. Create a virtual environment
# Using venv
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate   # On Linux/Mac
venv\Scripts\activate      # On Windows
  1. Install the required packages
pip install -r requirements.txt
  1. Issues The base requirement for bluetooth scanning is pybluez2, which is a Python wrapper for the BlueZ Linux Bluetooth stack. There might be issues installing the package from pip, so it is recommended to install it from the source.
pip install git+https://github.com/airgproducts/pybluez2.git@0.46

Alternatively, you can install pybluez, which should silently be called instead of pybluez2. If you encounter issues installing PyBluez, please refer to the latest comments on the project issues page.

Usage

To run any example, use the following command:

cd examples
python <example_name>.py

To run the EEG Streamer app, use the following command:

python opencortex/main.py

Examples

The examples folder contains single runnable scripts that demonstrate how to handle data collected using g.tec hardware.

Notebooks

The notebooks folder contains some examples on how to use the utilities provided in this repository. You can run the notebooks using Jupyter, Jupyter Lab or Google Colab.

Building

This project can be built as pip package using the following commands

Source Distribution

If you want to build a source distribution, run the following command:

python setup.py sdist

Copy the content of the dist folder to the desired location and install the package using pip:

pip install <package_name>.tar.gz

Wheel Distribution

Afterwards, to build a wheel distribution, run the following command:

python setup.py sdist bdist_wheel

Copy the content of the dist folder to the desired location and install the package using pip:

pip install <package_name>.whl

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

  1. Fork the project.
  2. Create a new branch.
  3. Make your changes and commit them.
  4. Push to the branch and create a pull request.

Credits

This project is freely available to anyone and is not intended for commercial use. If you use this project for academic purposes, please cite the original authors.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details. Packages used in this project are licensed under their respective licenses, as stated in the Acknowledgments section.

Authors

Please make sure to update the AUTHORS file if you are contributing to the project.

Acknowledgments

  • Brainflow, distributed under the MIT License.
  • LabStreamingLayer distributed under the MIT License.
  • MNE distributed under the BSD 3-Clause License.
  • Scikit-learn distributed under the BSD 3-Clause License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencortex-0.1.2.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencortex-0.1.2-py3-none-any.whl (99.0 kB view details)

Uploaded Python 3

File details

Details for the file opencortex-0.1.2.tar.gz.

File metadata

  • Download URL: opencortex-0.1.2.tar.gz
  • Upload date:
  • Size: 40.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for opencortex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9d89c727ce2a89d812723974f651e012a1ac12cb6dbced82c13d24c32b804f48
MD5 de716a4817d998e9100e83895b06825f
BLAKE2b-256 3860d0ecd6e2c1f3e3b511789ab7ed4806e2efb8a7f5efa9821e027f0ae57c05

See more details on using hashes here.

File details

Details for the file opencortex-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: opencortex-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 99.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for opencortex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68f094721d794142d4b62806ef296f5f9a3021cda89d975bfe965495670654fa
MD5 e2c744a028b1aee7901bc81d43561007
BLAKE2b-256 f3f4dfdc4ea0b5b3f975ebb01269f7d8ca296c07f5dc76ba13b4ec006feafe5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page