Giter VIP home page Giter VIP logo

bci2kreader's Introduction

BCI2kReader Build Status

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

bci2kreader's People

Contributors

markusadamek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.