Skip to main content

No project description provided

Project description

# BCI2kReader [![Build Status](https://travis-ci.com/neurotechcenter/BCI2kReader.svg?branch=master)](https://travis-ci.com/neurotechcenter/BCI2kReader) Python 3 and Python 2 compatible BCI2000 .dat file reader.

Reader for BCI2000 (https://www.neurotechcenter.org/research/bci2000/dissemination) .dat files. This project is a wrapper using the reader developed for the BcPy2000 project (http://bci2000.org/downloads/BCPy2000/BCPy2000.html)

to install the current release package use:

pip install BCI2kReader

This package is still under development, use with caution!

### USAGE:

from BCI2kReader import BCI2kReader as b2k

with b2k.BCI2kReader(‘yourbci2000testfile.dat’) as test: #opens a stream to the dat file

test.samplingrate # sampling rate

##### # you can use the reader for random access using read(), seek()

my_signals=test.signals #reads the whole file and stores it in a numpy matrix channels (channels,datapoints) my_states=test.states #reads all states as a dictionary .. my_signals, my_states=test.readall() # my_signals, my_states=test.read(-1) # reads from current position until end my_states[‘Running’] # access to the Running state

##### # By default calling test.signals, test.states and test.readall() caches all data in the object, this default behaviour can be changed by either calling the constructor with usecache=false or by calling .usecache(False). The cache can be cleared by calling .purge(), which should be called after you set usecache to false to free the memory. #### # the reader object also supports direct slicing

signalslice, stateslice = test[0:100] #returns the first 100 items, # this works with cached and non cached mode and does not alter the current position of the file pointer

#### # Slicing with states

test.states[:100] # returns all states within the slice frame # test.states[‘Running’][:,:100] is equivalent to test.states[:100][‘Running’] signals, states=test[test.States[‘StimulusCode’] == 1] # binary masks work in cached and uncached mode

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

BCI2kReader-0.32.dev0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

BCI2kReader-0.32.dev0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file BCI2kReader-0.32.dev0.tar.gz.

File metadata

  • Download URL: BCI2kReader-0.32.dev0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for BCI2kReader-0.32.dev0.tar.gz
Algorithm Hash digest
SHA256 f61647c41db628f063b9741a01c8748b39cee1377e4cbcdd8979315783c2c951
MD5 ec5f71cde8759efc99544fae6e06e083
BLAKE2b-256 7233ab9745a920b73bb4fc01d40bd88e6250369760d425762540e9779b9c1fa1

See more details on using hashes here.

File details

Details for the file BCI2kReader-0.32.dev0-py3-none-any.whl.

File metadata

  • Download URL: BCI2kReader-0.32.dev0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for BCI2kReader-0.32.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ebb6d3a29a2f7c1d63bfe89bef5bd25694413573e7c5c85364078157e15e460
MD5 6cb264b88e2efd75f40c2e3d8448978e
BLAKE2b-256 e780313305c8a7732efb743b05790b9ec17ee4ca25be1f9017c316dfce2ce509

See more details on using hashes here.

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