This is the main BCI class. The only thing you need to set up the BCI is a configuration file, that you can create either automatically - which is recommended - by using the module, made for that purpose, or write it manually.
|Parameter:||mode – True or False(default)|
Sets the security mode. A warning is raised if the number of returned blocks is not equal to the read ones.
|Parameter:||size (1 to 10, float or integer) – size of the trigger|
Sets the size of a shown trigger. Affects PyBCI only when the mode is ‘signs_enables_c’.
Resets the returning speed of data arrays.
|Parameter:||level – -9 (very slow) up to 9 (very fast). Possible exceptions: -10 (slowest level that is possible) and 10 (as fast as possible)|
Herewith you are able to relable the channels you want to get data from.
If you want to get just the current datablock (that is, one array the data is stored in, usually just a few samples) you may use this function.
|Rytpe:||numpy array [channels][samples]|
‘Main’ function to get data. For the specified time (in seconds) data is stored and then returned in a numpy array [channels][samples].
If security_mode is set to true (this is default), a warning is raised if the number of returned blocks is not equal to the read ones.
If <supervision_mode> is true (this is default), the Python data array is deleted and the data reading process is restarted if the Brain Recorder has been stopped to avoid ‘old’ data in the requested data array. Five zeros are written in the data file (if saving_mode is switched on) to ‘sign’ this stopping.
|Return type:||numpy array [channels][samples]|
Torder of the channels in the data array you’ll get is the one the channels are listed in channels.
You may use this function to give a sign in a seperate window with the shape <shape>. It is shown for <time> milliseconds.
It is shown for time milliseconds. When the sign is shown a trigger (‘5’) is sent via the parallel port.
This function saves the specified data to the data_file with format format. The data is saved transposed, so that each column represents one channel.
|Parameter:||format – ‘plain’(ascii txt), ‘pickle’, ‘binary’ or ‘mat’(MATLAB-file)|
This class is used just internally to start a new thread for giving signs C++ based. For the explanations of the parameters see the configuration module.
Equivalent classes for the other signing modes are
Sign_py(width_win, height_win, color_bg, color_trigger) and Sign_tk(width_win, height_win, color_bg, color_trigger).
This module may help you to create a configuration file for the BCI. Herefore you should use the function make_config, that is explained in the following.
This is the function to create a BCI configuration file automatically.
Module to estimate the impact of eye movements and blinks and to remove this impact from EEG data.
With this function, an impact array of eye movement artefacts is estimated. The difference between two conditions, namely a baseline or resting condition (without eye movements) and an artefact condition are used for calculating the impact of the latter condition on all channels of the baseline condition. It is assumed that the difference for one channel is composed of the influence of all the other channels (and herewith also of the EOG channels).
The two conditions are reflected in the two arguments for this function, with the following structure:
It is necessary for a valid estimation that the channels in the two data arrays are both equal and in the same order.
|Returns:||Another numpy array with the estimated impact. If you now take the dot product of this vector with a measured EEG signal vector, (f.i., calling remove_impact() you’ll get a vector without any activity that had caused exactly this difference between the two conditions.|
Use this function to get a signal array without any activity, that had previously caused the difference between the two conditions used for calculating the impact array (usually evaluated by estimate_impact()). In other words, activity is removed from the data, that correlates with the difference of the two conditions, that had ‘produced’ the impact array.
It is necessary for a valid estimation that the channels in the signal arrays are both equal and in the same order as in the data arrays used for estimating the impact array.
|Returns:||Signal numpy array, containing the corrected data values.|