Skip to main content

Python Noise-Tagging Brain-Computer Interface (PyntBCI)

Project description

PyntBCI

The Python Noise-Tagging Brain-Computer interface (PyntBCI) library is a Python toolbox for the noise-tagging brain-computer interfacing (BCI) project developed at the Donders Institute for Brain, Cognition and Behaviour, Radboud University, Nijmegen, the Netherlands. PyntBCI contains various signal processing steps and machine learning algorithms for BCIs that make use of evoked responses of the electroencephalogram (EEG), specifically code-modulated responses such as the code-modulated visual evoked potential (c-VEP). For a constructive review of this field, see:

  • Martínez-Cagigal, V., Thielen, J., Santamaría-Vázquez, E., Pérez-Velasco, S., Desain, P., & Hornero, R. (2021). Brain–computer interfaces based on code-modulated visual evoked potentials (c-VEP): a literature review. Journal of Neural Engineering. DOI: 10.1088/1741-2552/ac38cf

Installation

To install PyntBCI, use:

pip install pyntbci

Getting started

Various tutorials and example analysis pipelines are provided in the tutorials/ and examples/ folder, which operate on limited preprocessed data as provided with PyntBCI. Furthermore, please find various pipelines for several open-access datasets below in the pipelines/ folder.

Referencing

When using PyntBCI, please reference at least one of the following:

  • Thielen, J., van den Broek, P., Farquhar, J., & Desain, P. (2015). Broad-Band visually evoked potentials: re(con)volution in brain-computer interfacing. PLOS ONE, 10(7), e0133797. DOI: 10.1371/journal.pone.0133797
  • Thielen, J., Marsman, P., Farquhar, J., & Desain, P. (2021). From full calibration to zero training for a code-modulated visual evoked potentials for brain–computer interface. Journal of Neural Engineering, 18(5), 056007. DOI: 10.1088/1741-2552/abecef

Contact

Licensing

PyntBCI is licensed by the BSD 3-Clause License:

Copyright (c) 2021, Jordy Thielen All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Changelog

Version 1.0.0

Added

  • Variable decoding_length of rCCA in classifier controlling the length of a learned spectral filter
  • Variable decoding_stride of rCCA in classifier controlling the stride of a learned spectral filter
  • Function decoding_matrix in utilities to phase-shit the EEG data maintaining channel-prime ordering
  • Variable encoding_stride of rCCA in classifier controlling the stride of a learned temporal response
  • Module gating with gating functions, for instance for multi-component or filterbank analysis
  • Variable gating of rCCA in classifier to deal with multiple CCA components
  • Variable gating of Ensemble in classifier, for example to deal with a filterbank

Changed

  • Variable codes of rCCA in classifiers is renamed to stimulus
  • Variable transient_size of rCCA in classifiers is renamed to encoding_length
  • Class FilterBank in classifiers, is renamed to Ensemble
  • Function structure_matrix in utilities is renamed to encoding_matrix

Fixed

  • Several documentation issues

Version 0.2.5 (29-02-2024)

Added

  • Function eventplot in plotting to plot an event matrix
  • Variable running of covariance in utilities to do incremental running covariance updates
  • Variable running of CCA in transformers to use a running covariance for CCA
  • Variable cov_estimator_x and cov_estimator_x of rCCA in classifiers to change the covariance estimator
  • Event definitions "on", "off" and "onoff" for event_matrix in utilities

Changed

  • CCA separate computation for Cxx, Cyy and Cxy
  • CCA separate estimators for Cxx and Cyy

Fixed

  • ITR calculation zero-division

Version 0.2.4

Added

  • CCA cumulative/incremental average and covariance
  • Amplitudes (e.g. envelopes) in structure matrix
  • Maximum stopping time (max_time) for stopping methods
  • brainamp64.loc
  • A plt.show() in all examples

Changed

Fixed

  • ITR calculation zero-division

Version 0.2.3

Added

Changed

  • Improved documentation
  • Improved example pipelines
  • Improved tutorial

Fixed

Version 0.2.2

Added

  • TRCA transformer
  • eTRCA classifier
  • Ensemble (ensemble) option (i.e., a spatial filter per class) for classifiers

Changed

  • Package name change of PyNT to PyntBCI
  • Filterbank order optimized given parameters

Fixed

  • Issue causing novel events in M when "cutting cycles"
  • Correlation does not change mutable input variables

Version 0.2.1

Added

  • Tests
  • Tutorial

Changed

  • Non-binary events for rCCA

Fixed

Version 0.2.0

Added

  • Dynamic stopping: margin, beta, Bayes
  • Inner score metric

Changed

  • All data shapes: trials, channels, samples
  • All codes shapes: classes, samples
  • Changed all decision functions to similarity, not distance (e.g., Euclidean), to always maximize

Fixed

  • Zero-mean templates in eCCA and rCCA

Version 0.1.0

Added

  • Filterbank classifier

Changed

  • Classifiers all have predict() and decision_function()

Fixed

Version 0.0.2

Added

Changed

  • CCA method changed from sklearn to covariance method

Fixed

Version 0.0.1

Added

  • eCCA template metrics: average, median, OCSVM
  • eCCA spatial filter options: all channels or subset

Changed

Fixed

Version 0.0.0

Added

  • CCA transformer
  • rCCA classifier
  • eCCA classifier

Changed

Fixed

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

pyntbci-1.0.0.tar.gz (45.2 MB view hashes)

Uploaded Source

Built Distribution

pyntbci-1.0.0-py3-none-any.whl (45.2 MB view hashes)

Uploaded Python 3

Supported by

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