Skip to main content

mindaffectBCI

This repository contains the python SDK code for the Brain Computer Interface (BCI) developed by the company Mindaffect.

Online Documentation and Tutorials

Available at: https://mindaffect-bci.readthedocs.io/

Installation

To install from source (currently the recommended method):
  1. Clone or download this repository:

    git clone https://github.com/mindaffect/pymindaffectBCI
  2. Install the necessary bits to your local python path:

  1. change to the directory where you cloned the repository.

  2. Add this module to the python path, and install dependencies:

    pip install -e .

To install as a python library:

pip install --upgrade mindaffectBCI

Installation Test

You can run a quick test if the installation without any additional hardware by running:

python3 -m mindaffectBCI.online_bci --acquisition fakedata

Essentially, this run the SDK test code which simulates a fake EEG source and then runs the full BCI sequence, with decoder discovery, calibration and prediction.

If all is successfully installed then you should see a window like this open up.

<img src=’docs/images/mainmenu.png’ width=300>

If you now press 2 you should see a flickering grid of “buttons” like below. You should see a random one briefly flash green (it’s the target) then rapidly flicker and eventually turn blue (to indicate it’s selected.)

<img src=’docs/images/selectionMatrix.png’ width=300>

If all this works then you have successfully installed the mindaffectBCI python software. You should now ensure your hardware (display, amplifier) is correctly configured before jumping into BCI control.

Important: FrameRate Check

For rapid visual stimulation BCI (like the noisetagging BCI), it is very important that the visual flicker be displayed accurately. However, as the graphics performance of computers varies widely it is hard to know in advance if a particular configuration is accurate enough. To help with this we also provide a graphics performance checker, which will validate that your graphics system is correctly configured. You can run this with:

python3 -m mindaffectBCI.examples.presentation.framerate_check

As this runs it will show in a window your current graphics frame-rate and, more importantly, the variability in the frame times. For good BCI performance this jitter should be <1ms. If you see jitter greater than this you should probably adjust your graphics card settings. The most important setting to consider is to be sure that you have _vsync_ <https://en.wikipedia.org/wiki/Screen_tearing#Vertical_synchronization> turned-on. Many graphics cards turn this off by default, as it (in theory) gives higher frame rates for gaming. However, for our system, frame-rate is less important than exact timing, hence always turn vsync on for visual Brain-Compuber-Interfaces!

Brain Computer Interface Test

If you have:
  1. installed pyglet , e.g. using pip3 install pyglet

  2. installed brainflow , e.g. using pip3 install brainflow

  3. have connected an openBCI ganglion ,

  4. have followed MindAffect headset layout.pdf to attach the electrodes to the back of your head.

Then you can jump directly to trying a fully functional simple letter matrix BCI using:

python3 -m mindaffectBCI.online_bci

Note: For more information on how to run an on-line BCI, including using other supported amplifiers, see our complete on-line documentation and in particular our tutorials section.

Getting Support

If you run into and issue you can either directly raise an issue on the projects github page

File Structure

This repository is organized roughly as follows:

  • mindaffectBCI - contains the python package containing the mindaffectBCI SDK. Important modules within this package are: - noisetag.py - This module contains the main API for developing User Interfaces with BCI control - utopiaController.py - This module contains the application level APIs for interacting with the MindAffect Decoder. - utopiaclient.py - This module contains the low-level networking functions for communicating with the MindAffect Decoder - which is normally a separate computer running the eeg analysis software. - stimseq.py – This module contains the low-level functions for loading and codebooks - which define how the presented stimuli will look.

  • decoder - contains our open source python based Brain Computer Interface decoder, for both on-line and off-line analysis of neuro-imaging data. Important modules within this package are: - decoder.py - This module contains the code for the on-line decoder. - offline_analysis.ipynb - This juypter notebook contains to run an off-line analysis of previously saved data from the mindaffectBCI or other publically available BCI datasets.

  • examples - contains python based examples for Presentation and Output parts of the BCI. Important sub-directories
    • output - Example output modules. An output module translates BCI based selections into actions.

    • presentation - Example presentation modules. A presentation module, presents the BCI stimulus to the user, and is normally the main UI. In particular here we have: - framerate_check.py - Which you can run to test if your display settings (particularly vsync) are correct for accurate flicker presentation. - selectionMatrix.py - Which you can run as a simple example of using the mindaffectBCI to select letters from an on-screen grid.

    • utilities - Useful utilities, such as a simple raw signal viewer

    • acquisition - Example data acquisition modules. An acquisition module interfaces with the EEG measurment hardware and streams time-stamped data to the hub.

  • docs – contains the documentation.

    • source – contains the source for the documentation, in particular this directory contains the juypter notebooks for tutorials on how to use the mindaffectBCI.

Metadata

Release files for mindaffectBCI 0.9.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mindaffectBCI 0.9.24
File Size Uploaded Provenance Actions
mindaffectBCI-0.9.24.tar.gz 397.3 kB Without provenance Details for mindaffectBCI-0.9.24.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mindaffectBCI 0.9.24
File Interpreter ABI Platform Actions
mindaffectBCI-0.9.24-py3-none-any.whl Python 3 none any Details for mindaffectBCI-0.9.24-py3-none-any.whl

Total release size: 1.0 MB

Release files / mindaffectBCI-0.9.24.tar.gz

Download URL mindaffectBCI-0.9.24.tar.gz
Size 397.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2eccfcbbf720f0d9c06bb603c3d7649e93a97398e91e74c4a21ce571935a6c9f
BLAKE2b-256 checksum
How to use checksums
834715ffff3ae90711a8d82ae801e350de83cb18200013d193e6d6d991b9ccad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.4

Release files / mindaffectBCI-0.9.24-py3-none-any.whl

Download URL mindaffectBCI-0.9.24-py3-none-any.whl
Size 637.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bde4b0046c5d074acc9b6782109d9a0017b0c0437c29fe71dcdbf4fcefaa92a0
BLAKE2b-256 checksum
How to use checksums
7a26400c6ed8a2859c6e03796e9b28bb30c0b9adb1d9a53c3cd1edb8b62c7aa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.4

Security for mindaffectBCI 0.9.24

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page