Skip to content

A collection of utilities for interfacing with EEG devices.

License

Notifications You must be signed in to change notification settings

BRomans/OpenCortex

Repository files navigation

OpenCortex

OpenCortex is a fully-featured EEG streaming app to stream EEG data and markers.

  • GUI to plot EEG in real-time
  • signal filters (visualization only)
  • signal quality estimators
  • a button to save custom markers on the data
  • an inlet stream that can receive event markers through LSL from an external source
  • an outlet stream that can send raw EEG to an external source
  • a general-purpose classifier class that can be initialized with any model from Scikit-Learn
  • cross-validation plots with ROC curve and Confusion Matrix
  • educational Jupyter notebooks to analyse EEG data using the library MNE and to perform classification tasks using Scikit-Learn.

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/CortexToolkit.git
cd CortexToolkit
  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 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.

About

A collection of utilities for interfacing with EEG devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published