Package: bci-essentials
bci-essentials-pythonThis repository contains python modules and scripts for the processing of EEG-based BCI.
These modules are specifically designed to be equivalent whether run offline or online.Related packagesThe front end for this package can be found inbci-essentials-unityGetting StartedWiki– More detailed installation instructions and tutorials.API documentationInstallationBCI Essentials requires Python 3.9 or later.  To install for Windows, MacOS or Linux:pip install bci-essentialsOn some systems, it may be necessary to installliblsl.  Alternatively, use the Condaenvironmentto set up dependencies that are not provided by pip:conda env create -f ./environment.yml
conda activate bciOffline processingOffline processing can be done by running the corresponding offline test script (ie. mi_offline_test.py, p300_offline_test.py, etc.)
Change the filename in the script to point to the data you want to process.python examples/mi_offline_test.pyOnline processingOnline processing requires an EEG stream and a marker stream. These can both be simulated using eeg_lsl_sim.py and marker_lsl_sim.py.
Real EEG streams come from a headset connected over LSL. Real marker streams come from the application in the Unity frontend.
Once these streams are running, simply begin the backend processing script ( ie. mi_unity_backend.py, p300_unity_bakend.py, etc.)
It is recommended to save the EEG, marker, and response (created by the backend processing script) streams usingLab Recorderfor later offline processing.python examples/mi_unity_backend.pyDirectorybci_essentialsThe main packge containing modules for BCI processing.eeg_data.py         -   module for reading online/offline data, windowing, processing, and classifying EEG signalsclassification.py   -   module containing relevant classifiers for eeg_data, classifiers can be extended to meet individual needssignal_processing.py-   module containing functions for the processing of EEG_datavisuals.py          -   module for visualizing EEG dataexamplesExample scripts and data.data                        -   directory containing example data for P300, MI, and SSVEPeeg_lsl_sim.py              -   creates a stream of mock EEG data from an xdf filemarker_lsl_sim.py           -   creates a stream of mock marker data from an xdf filemi_offline_test.py          -   runs offline MI processing on previously collected EEG and marker streamsmi_unity_backend.py         -   runs online MI processing on live EEG and marker streamsp300_offline_test.py        -   runs offline P300 processing on previously collected EEG and marker streamsp300_unity_backend.py       -   runs online P300 processing on live EEG and marker streamsssvep_offline_test.py       -   runs offline SSVEP processing on previously collected EEG and marker streamsssvep_unity_backend_tf.py   -   runs online SSVEP processing on live EEG and marker streams, does not require trainingssvep_unity_backend.py      -   runs online SSVEP processing on live EEG and marker streamsswitch_offline_test.py      -   runs offline switch state processing on previously collected EEG and marker streamsswitch_unity_backend.py     -   runs online switch state processing on live EEG and marker streams