Example #1
0
# Additionally, we want to write the data into a binary file.

# Thus, we create a configuration file to save our parameters.
make_config('BCI.cfg', sample_rate = sample_rate, numof_channels = numof_channels,
            mode = mode, saving_mode = True,
            data_file = 'example_file.dat',
            format = 'binary', resolution = resolution,
            returning_speed = returning_speed, channels = channels
            color_bg = color_bg, color_trigger = color_trigger,
            size_window = size_window)



# To start the BCI, the only thing we need now is the configuration file, containing our specified parameters.
example_bci = BCI('BCI.cfg')


# We are not quite satisfied with the channel labels,
# because the channels we want to 'read' are on positions [1,2,3,12,5,10,7,8,20,30] in the Brain Recorder Software.
# So we have to relabel the channels on position 3, 6 and 10.

example_bci.change_channellabels(3, 3)
example_bci.change_channellabels(6, 10)
example_bci.change_channellabels(10, 30) 


# We want to let the EEG run a bit before we are interested in the data.
# This may be the case, for example, if you have to save your recordings first.
time.sleep(2)  
Example #2
0
OTHER DEALINGS IN THE SOFTWARE."""


"""
This is an example how to use the functions of the EyemoveCorrectur module
to estimate and remove artefacts caused by eye movements.
"""

import numpy as N
import time
from PyBCI import BCI
from PyBCI.tools.EyemoveCorrector import *


# We'll assume that you have already created a configuration file
example_bci = BCI("BCI.cfg")


# There are four condition we need for an estimation of eye movement artefacts:
conditions = ["resting", "horizontal", "vertical", "blinks"]

trials = 20
sec_per_trial = 2

# Make sure that the following matches with your config file.
numof_channels = 5
sample_rate = 500

condition_means = N.zeros((len(conditions), numof_channels))

for num, condition in zip(range(len(conditions)), conditions):