Jump to content

User Tutorial:Configuring Online Feedback: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
No edit summary
Ckong (talk | contribs)
 
(58 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This tutorial step assumes that you have [[User Tutorial:Obtaining Mu Rhythm Parameters in an Initial Session|obtained Mu rhythm parameters]] in an initial session.
This tutorial step assumes that you have performed and [[User Tutorial:Analyzing the Initial Mu Rhythm Session|analyzed an initial session]].
Now you are going to create a subject-specific parameter configuration for on-line feedback.
Now you are going to create a subject-specific parameter configuration for on-line feedback.


Line 6: Line 6:


==Subject-Specific Parameters==
==Subject-Specific Parameters==
In the next step, we construct a full parameter file for the subject:
Now, we will construct a full parameter file that is specific to that subject:
*In the configuration window, click ''Load Parameters'' to load <tt>parms/mu_tutorial/MuFeedback.prm</tt>.
*In the configuration window, click "Load Parameters" to load the parameter file at <tt>parms/examples/SMR_basket_task.prm</tt>.
*Additionally, load your amplifier configuration from <tt>parms/fragments/amplifiers</tt>.
*In the '''Storage''' tab:
*Go to the ''Storage'' tab, and enter the subject's name or ID into the ''SubjectName'' parameter.
**Change the ''SubjectName'' field to the subject's initials.
*Into the ''SubjectSession'' parameter, enter ''002''.
**Make sure the ''SubjectSession'' field is set to <tt>002</tt> and ''SubjectRun'' is set to <tt>01</tt>.
===Configuring the Classifier===
Subject-specific electrode location and Mu rhythm frequency are part of the classifier's configuration.
They are entered into the ''Classifier'' parameter on the ''Filtering'' tab; there, click the ''Edit Matrix'' button associated with the ''Classifier'' parameter.
#Set ''Number of columns'' to 4, and ''Number of rows'' to 1 (or the number of features that you wish to use); then, click ''Set new matrix size'' to apply your changes.
#In the first column (of the first row), labeled ''input channel'', enter the location of the feedback electrode, e.g. <tt>CP3</tt>. If you did not specify electrode locations when configuring the spatial filter, enter the channel number associated with the feedback electrode.
#In the second column, labeled ''input element (bin)'', enter feedback frequency in Hz, immediately followed with ''Hz'', as in <tt>12Hz</tt>.
#In the third column, enter the value 2 corresponding to the control channel for vertical control of the cursor.
#In the fourth column, enter 1 as the weight.
#If you wish to use more than one feature, repeat steps 2-5 for each additional feature moving down a row each time (i.e., enter the 2nd feature on the 2nd row, etc...).
#Finally, save your configuration to <tt>parms/subjects/mu_feedback/<Subject>002.prm</tt>, or whereever you find appropriate.


==Next Step==
==The Spatial Filter==
In the next step, you will learn how to actually [[User Tutorial:Performing a Mu Rhythm Feedback Session|perform a Mu rhythm feedback session]] using the configuration created in the present step.
[[Image:SpatialFilter.PNG|right|800px]]
The Spatial Filter computes a weighted combination of the incoming data from the electrodes based on their placement on the scalp of the subject.
 
Because we are targeting specific areas of the brain to monitor, we use a spatial filter that allows the program to identify when the electrode of interest is activating specifically.
 
This is done by subtracting the average of the surrounding electrodes' data from the electrode of interest. For example, as seen to the right the output channel <tt>C3_OUT</tt> is the data from <tt>C3</tt> minus one-quarter each of <tt>F3</tt>, <tt>T7</tt>, <tt>Cz</tt>, and <tt>Pz</tt>. Such a filter is called a "Laplacian filter".
 
*On the '''Filtering''' tab, go to ''SpatialFilter'', and make sure that "full matrix" is selected in the ''SpatialFilterType'' field. Then, click the '''Edit matrix''' button next to ''SpatialFilter'' to open the matrix editor.
*For column headings, enter channel names in the same order as you did previously. Double-click a column heading to edit.
*Enter Laplacian filter coefficients as appropriate for your montage--you might need to reorder columns from the example above.
{|
|height="300px"|
|}
 
==The Classifier Matrix==
[[Image:ClassifierMatrix.PNG|right|800px]]
The Classifier Matrix applies weights to the incoming data that allows the program to accurately identify Mu Rhythm signals. This matrix is opened by clicking '''Edit Matrix''' next to the ''Classifier'' parameter in the '''Filtering''' tab.
*Set ''Number of columns'' to 4, and ''Number of rows'' to 1. Click ''Set new matrix size'' to apply your changes.
*In the first column (of the first row), labeled ''input channel'', enter <tt>C3_OUT</tt> or <tt>1</tt> if the right hand are being used, <tt>C4_OUT</tt> or <tt>3</tt> for the left hand, or <tt>Cz_OUT</tt> or <tt>2</tt> for the feet.
**If both hands are being used, set ''Number of rows'' to 2, and click '''Set new matrix size'''. Enter <tt>C3_OUT</tt> under ''input channel'' in the first row, and <tt>C4_OUT</tt> in the second.
*In our example, as "right hand vs. rest" is our best feature, we will enter <tt>1</tt>.
*In the second column, labeled ''input element (bin)'', enter feedback frequency in Hz, immediately followed with <tt>Hz</tt>, as in <tt>12Hz</tt> from [[User Tutorial:Analyzing the Initial Mu Rhythm Session#Generating Spectra and Topography Plots|the previous page]].
*In the third column, enter the value <tt>2</tt>. This corresponds to the control channel for vertical control of the cursor.
*In the fourth column, enter 1 as the weight. For further calibration, this weight can be increased to give stronger control or decreased to give finer control.
*Finally, save your configuration in a parameter file wherever you find appropriate.
 
{|
|height="200px"|
|}
 
==Performing Mu Rhythm Feedback Sessions==
Proper calibration of the Classifier and Spatial matrices are what takes the most time. A Mu Rhythm Feedback Session should be performed with the classifier matrix to gauge the efficacy of the settings. In the next step, you will learn how to actually [[User Tutorial:Performing a Mu Rhythm Feedback Session|perform a Mu rhythm feedback session]] using this configuration.


==See also==
==See also==
[[User Tutorial:Mu Rhythm BCI Tutorial]], [[User Reference:SpatialFilter]], [[User Reference:LinearClassifier]]
[[User Tutorial:Mu Rhythm BCI Tutorial]], [[User Reference:LinearClassifier]]


[[Category:Tutorial]]
[[Category:Tutorial]]

Latest revision as of 14:56, 29 July 2019

This tutorial step assumes that you have performed and analyzed an initial session. Now you are going to create a subject-specific parameter configuration for on-line feedback.

Starting up BCI2000

Start BCI2000 using the appropriate batch file at batch/CursorTask_<YourAmplifier>.bat. You might consider creating a link to this file on the desktop.

Subject-Specific Parameters

Now, we will construct a full parameter file that is specific to that subject:

  • In the configuration window, click "Load Parameters" to load the parameter file at parms/examples/SMR_basket_task.prm.
  • In the Storage tab:
    • Change the SubjectName field to the subject's initials.
    • Make sure the SubjectSession field is set to 002 and SubjectRun is set to 01.

The Spatial Filter

The Spatial Filter computes a weighted combination of the incoming data from the electrodes based on their placement on the scalp of the subject.

Because we are targeting specific areas of the brain to monitor, we use a spatial filter that allows the program to identify when the electrode of interest is activating specifically.

This is done by subtracting the average of the surrounding electrodes' data from the electrode of interest. For example, as seen to the right the output channel C3_OUT is the data from C3 minus one-quarter each of F3, T7, Cz, and Pz. Such a filter is called a "Laplacian filter".

  • On the Filtering tab, go to SpatialFilter, and make sure that "full matrix" is selected in the SpatialFilterType field. Then, click the Edit matrix button next to SpatialFilter to open the matrix editor.
  • For column headings, enter channel names in the same order as you did previously. Double-click a column heading to edit.
  • Enter Laplacian filter coefficients as appropriate for your montage--you might need to reorder columns from the example above.

The Classifier Matrix

The Classifier Matrix applies weights to the incoming data that allows the program to accurately identify Mu Rhythm signals. This matrix is opened by clicking Edit Matrix next to the Classifier parameter in the Filtering tab.

  • Set Number of columns to 4, and Number of rows to 1. Click Set new matrix size to apply your changes.
  • In the first column (of the first row), labeled input channel, enter C3_OUT or 1 if the right hand are being used, C4_OUT or 3 for the left hand, or Cz_OUT or 2 for the feet.
    • If both hands are being used, set Number of rows to 2, and click Set new matrix size. Enter C3_OUT under input channel in the first row, and C4_OUT in the second.
  • In our example, as "right hand vs. rest" is our best feature, we will enter 1.
  • In the second column, labeled input element (bin), enter feedback frequency in Hz, immediately followed with Hz, as in 12Hz from the previous page.
  • In the third column, enter the value 2. This corresponds to the control channel for vertical control of the cursor.
  • In the fourth column, enter 1 as the weight. For further calibration, this weight can be increased to give stronger control or decreased to give finer control.
  • Finally, save your configuration in a parameter file wherever you find appropriate.

Performing Mu Rhythm Feedback Sessions

Proper calibration of the Classifier and Spatial matrices are what takes the most time. A Mu Rhythm Feedback Session should be performed with the classifier matrix to gauge the efficacy of the settings. In the next step, you will learn how to actually perform a Mu rhythm feedback session using this configuration.

See also

User Tutorial:Mu Rhythm BCI Tutorial, User Reference:LinearClassifier