Jump to content

Parameters

From BCI2000 Wiki

Parameters are the BCI2000 data type that contains constant, static information. This is best used for task settings, amplifier configuration, and user settings. Parameters are loaded into BCI2000, are able to be changed by the user, and then are saved into the BCI2000 data file. With parameters, all the information about the experiment can be recovered in the analysis.

This page provides a summary of parameters for both users and developers. Users can interface with parameters in a variety of ways, detailed below. Developers can learn how to create their own parameters with a BCI2000 filter.

Parameter design

Parameter files are saved as a .prm file. Each parameter is one line. A parameter can be a string, float, boolean, integer, matrix, enumeration, file, directory, or color.

More detailed information about the syntax can be found here. However, it is very tedious to edit these parameters in this format. Instead, they can be opened in a tool called BCI2000FileInfo or set in Matlab, as detailed below.

Viewing Parameters in BCI2000

Parameters are most easily viewed in the BCI2000 Parameter Configuration window. This can either be opened with BCI2000FileInfo, or by pressing the Config button in the main BCI2000 window.

The parameter configuration window, opened with either BCI2000FileInfo or the Config button

Once you have navigated the tabs and changed whichever parameters you desire, click on Save Parameters to save the parameters to a .prm file. Likewise, if you already have the parameter file and want to load it, click on Load Parameters.

Further information is detailed here.

Advanced Features

  • Configure Save and Configure Load buttons: These limit which parameters are saved/loaded. It is BCI2000 "best practice" to save only the parameters you change, and always load every parameter (Configure Load should always have every box enabled). This means before you click Save Parameters, change Configure Save to the parameters you changed. This saves a parameter file with only a couple parameters, commonly called a parameter fragment.
  • Sliding bar: This defines the parameter's User Level. The User Level can be specified in the Preferences Dialog (File -> Preferences). By default it is set to the highest level, but if you change it, only the parameters which are at or below the user level will appear. For example, if SubjectName is set to the 2nd level and SubjectSession to the 1st level, if the UserLevel is set to level 2, both SubjectName and SubjectSession will be shown, while SubjectRun (still at level 3) will not appear. If the UserLevel is then set to level 1, only SubjectSession will appear.

Setting Parameters (Matlab / Python)

Another easy way to populate parameters is through either Matlab or Python. Matlab uses a mex file convert_bciprm, while Python uses a function by the same name. This function takes the parameter struct as the input, and output a .prm file.

Examples can be found here for both Matlab and Python

Loading Parameters

  1. Clicking Load Parameters in the parameter configuration window (above)
  2. Using the Load ParameterFile command in your batch file.
  3. Load parameter file with BCI2000Remote. Refer to this page for the command in each possible language.

Accessing Parameters

  1. Loading the .dat file, which returns the signal, states, and parameters: load_bcidat in Matlab or BCI2kReader in Python.
  2. Loading the .prm or .dat file in BCI2000FileInfo

Creating Parameters (for Developers)

Parameters are defined in the Publish method of a BCI2000 filter, using the same syntax of parameter lines.

Elsewhere in your BCI2000 filter, you can access the parameter according to the syntax here and here. If you really want the full syntax, it is described here. And here are some notes on rules for parameter access.