- 1 Compiling, Building, and Debugging Issues
- 2 Troubleshooting
- 3 Configuration
- 4 Data Analysis
- 5 See also
Compiling, Building, and Debugging Issues
For programming-related information, please see
- Frequently Asked Questions
- Programming Howto:Quickstart Guide
- Programming Howto:Building and Customizing BCI2000
- Programming Howto:SVN Client Setup
- Programming Howto:Using TortoiseSVN
Q: In the EEG source display, the visualization cursor does not move at a constant speed but appears jumping.
Q: The feedback cursor is not updated at a constant rate but appears to be jumping.
A: In the timing display window, check whether block duration (the top curve in the Timing Display) is constantly at the level indicated by the tick mark to the left. When this is the case, the jumping cursor is merely a cosmetic problem. Otherwise, try the following:
- Increase the "VisualizeSourceDecimation" parameter on the "Visualize" tab to reduce the processor load associated with the source signal display.
- Increase the "SampleBlockSize" parameter to reduce the system update rate.
Q: When clicking 'Set Config', I get error messages for each of the modules such as: "EEGSource: Could not make a connection to the SignalProcessing Module" and "Application: SignalProcessing dropped connection unexpectedly."
A: This may be caused by the "Microsoft TV/Video Connection" in Network Connections, if you have it. To remedy this:
- Right-click on My Network Places,
- Select Properties,
- Right-click on Microsoft TV/Video Connection,
- Select Properties,
- Uncheck Internet Protocol,
- Click OK.
Q: When I start the gUSBamp source module, I get the error message: "Cannot find ordinal 37 in dynamic library gUSBamp.dll".
A: Most likely, your gUSBamp source module finds an incompatible version of the gUSBamp.dll driver library. Make sure that, in the directory where gUSBampSource.exe resides, there is a file gUSBamp.dll in the exact version that originally came with your BCI2000 distribution.
Q: The first time a subject is run using the cursor feedback protocol, during the first trial of the first run only, the cursor moves to the top of the screen and does not respond to user input. BCI2000 outputs increasingly large negative numbers during this run.
A: This is not so much a bug as a side effect of the way the adaptation mechanism works. Since the adaptation mechanism hasn't been trained, all it has are the initial values for offset and gain. For each subject, it will take a few trials to adapt BCI2000 to this subject's signals.
Therefore, you will typically save a subject's adapted parameters after each session, and use this as a starting point for the next session. Alternatively, you may load a subject's parameters from a previous session's data file by specifying the data file rather than a parameter file from the Load parameters... dialog.
gUSBamp not recognized
Q: The BCI2000 gUSBamp source module does not recognize my gUSBamp amplifier. When I click "Set Config", I get the an error message: gUSBampADC::Preflight: Could not detect any amplifier. Make sure there is a single gUSBamp amplifier connected to your system, and switched on. I made sure that the amplifier was attached, switched on, and would work with Guger's demonstration program.
A: The current version of the BCI2000 gUSBamp source module will not work with the first generation of gUSBamps. Please contact gtec for a firmware update, or amplifier replacement.
Using a Contributed Source Module
Q: I have an amplifier that is listed under Contributions:ADCs, but I don't know how to actually use it with BCI2000.
A: Please see the howto page on using contributed source modules.
Replaying Recorded Data
Q: Rather than controlling BCI2000 from a brain signal, I would like to use a recorded data file as input. Is there a kind of "replay mode" in BCI2000?
A: While there exists a contributed source module that reads from a file, we have not included it into the BCI2000 core distribution, and that for at least two reasons:
- If the version of BCI2000 that you are using is not the exact same as the one that was used to record the data, and/or you change some system parameters, then, depending on the experimental paradigm, results may be undefined. E.g., in a 2D cursor task, what should happen if you slow down the cursor such that the cursor has not yet reached a target when in the original data file it has (i.e., and the trial is over?).
- Scientifically, it is a bad idea to "simulate" online performance by loading a datafile, changing a few parameters, and seeing how it would have worked. If you are interested in evaluating the effect of different signal processing routines, you should write your own offline analysis routine that uses statistical analyses, together with a comprehensive body of data, or you need to run comprehensive online studies.
For off-line analyses, you might also check out the Command Line Processing Environment which allows you to feed existing data files into arbitrary BCI2000 filter chains.
Q: Is there a way to obtain the same random sequence each time BCI2000 is run? I don't care about the sequence itself, it should just be the same each time.
A: The SignalGenerator source module has a parameter, RandomSeed, that determines the pseudo random number generator's seed value. If this parameter is zero, the generator will be initialized from the system timer.
While absent from other BCI2000 modules by default, each component that uses the BCI2000 pseudo random generator will behave according to this parameter if it is present. To introduce the RandomSeed parameter into a module that does not provide the RandomSeed parameter, use --RandomSeed=10 as a command line option to that module when starting up BCI2000. Note that the parameter will have the same value across all modules (10 in the example), and it will appear on the "System" tab in the operator module's parameter dialog.
Q: Is visual stimulation synchronized with screen refresh (vertical blanks)?
A: BCI2000 does not synchronize its video output with refresh cycles to avoid interference with its own timing. Also, for visually evoked potentials, it appears not to matter much whether video output is synchronized or not. If you feel that output should be synchronized, and have access to the BCI2000 source code, adding a DirectDraw WaitForVerticalBlank() call immediately before the Task filter's call to UpdateWindow() at the end of its Process() function should help.
Q: The StimulusPresentation program only allows for either a random sequence of stimuli, or a deterministic sequence of stimuli. In my experimental paradigm, I would like to present random stimuli, but have them interspersed by a particular resting stimulus. It looks like BCI2000 does not support that?
A: BCI2000 can present any sequence of stimuli. Referring to the example above, where 1 may be the resting stimulus and stimuli 2-9 are to be randomly presented, the following could be a valid sequence: 1 3 1 2 1 9 1 8 1 5 1 6. Such a sequence could be determined using an external procedure, and then BCI2000 could be configured using that particular sequence. Specifically, it would be possible to write a Matlab program similar to the one below.
num_values=9; r=round(rand(1, num_values)*num_values+1); fp=fopen('fragment.prm', 'wb'); fprintf(fp, 'Application:Sequencing intlist Sequence= %d', num_values*2); for i=1:num_values fprintf(fp, ' 1 %d', r(i)); end fprintf(fp, ' 1 1 % % // test parameter\r\n'); fclose(fp);
Execution of that Matlab program would produce a parameter file fragment fragment.prm. When loaded on top of a full parameter file, this would produce a random sequence. This process can be fully automated using BCI2000 batch files, scripting, and command line parameters so that clicking on one icon could run that Matlab program, execute BCI2000, load a full parameter file, load the parameter file fragment (containing the randomized sequence) produced by Matlab, set the configuration, and start operation.
Q: I would like to control the CursorTask in BCI2000 using a joystick or a mouse, e.g. to implement a standard center-out paradigm. How do I do that?
A: As so often, there are different ways of accomplishing a particular goal. In this case, it would be possible to change the source code of the CursorTask such that it would be controlled by, for example, a joystick. However, BCI2000 supports a solution that is much more elegant and powerful. This solution is based on the Expression Filter. Cursor movement in the Cursor Task is controlled by the first and second control signal produced by the Signal Processing module. Typically, this control signal is controlled by the brain signals that are classified by the Linear Classifier. However, after classification, the control signals are also passed through the Expression Filter where they can be modified using an algebraic expression. This algebraic expression has access to BCI2000 states, and joystick position can easily be logged in states using the --LogJoystick=1 command line option when starting up the Source Module. Thus, first, logging of joystick position needs to be enabled using that command line option. Then, the Expression Filter needs to be configured to simply replace the first and second control signal by the states that represent joystick position. This is accomplished by simply setting the parameter Expressions to the following 2-by-1 matrix:
By modifying the simple expression shown above, it would also be easy to use a combination of classified brain signals and states to drive an output such as the Cursor Task.
Q: I would like to apply a filter to recorded data, and then use the BCI2000 OfflineAnalysis and P300Classifier tools for data analysis.
A: You may achieve this using Matlab. First, use the load_bcidat mex file to load data into Matlab. Then, apply the desired filtering to the "signal" output variable. Finally, save the resulting filtered data using the save_bcidat mex file. For elementary filtering operations, this procedure has been wrapped up in a simple Matlab GUI. See Contributions:FilterGUI for a description of this program.
Q: I would like to see what would have happened if I had set my online processing parameters differently.
A: You can perform an offline analysis by recreating a BCI2000 filter chain either from the system command-line or from within Matlab. In either case, it is possible to substitute different parameter values into the processing chain. Naturally, however, if the original experiment included any kind of feedback that was dependent on the processed signal, you will not see the effects of this since you are working with a "frozen" data set that reflects the activity of a brain that was experiencing the results of the original parameters only. Also, you should be aware that finding the "best" set of parameters for a given data-set is not the same thing as finding the parameter set that will work best next time. If you optimize parameters on a fixed data set, and do not hold out some data on which to perform (once only) a final evaluation, then you will almost certainly be looking at an unrealistically inflated level of performance, and may end up with parameters that will generalize less well to new data.