Jump to content

User Tutorial:Obtaining Mu Rhythm Parameters in an Initial Session

From BCI2000 Wiki

Although the basic properties of the Mu rhythm are identical for all humans, spatial patterns and exact frequencies will differ. Thus, it is necessary to obtain these individual parameters prior to any feedback experiments, in an initial session.

Experimental Design

In the initial session, the subject is instructed to imagine hand and/or feet movements according to a pre-defined pattern. To identify a subject's Mu Rhythm, the amplitude of the EEG signal is then taken for different frequency bands, and correlated with instructions. Across frequencies, this results in a line spectrum; across electrode locations, the result is a spatial distribution of activity.

Performing the Initial Session

  • Start BCI2000 by double-clicking batch/StimulusPresentation_<YourAmplifier>.bat. For repeated use, placing a link to this file on the desktop might be a good idea.
  • In the operator module, click "Config".
  • Click "Load Parameters" to load the parameter file at parms/mu_tutorial/InitialMuSession.prm.
  • Load additional parameters for your amplifier by clicking "Load Parameters" again and choosing the parameter file from parms/fragments/amplifiers that corresponds to your amplifier. If you're unable to find a parameter file that corresponds to your amplifier and your amplifier is listed in the contributions section, load the SignalGenerator.prm parameter file (also located in parms/fragments/amplifiers) and modify parameters as necessary. Please see User Reference:Parameters for a listing of currently supported parameters along with their descriptions.
  • When you have a separate monitor for experimenter and subject, load the parameter file at parms/fragments/stdlib/DualMonitor.prm.
    • In your system's display properties configuration, make sure that the subject's monitor is configured to be located to the right of the main monitor.
    • Make sure the WindowLeft parameter matches the main monitor's actual pixel width.
    • You may need to adapt WindowTop, WindowWidth, and WindowHeight parameters as well; click "Set Config" to try the effect of your changes.
  • Under the "Storage" tab, enter the subject's initials into the "SubjectName" parameter.
  • Switch to the "Source" tab; for the "ChannelNames" parameter enter electrode locations corresponding to amplifier channels as a white-space separated list (e.g., Fz CPz Cz CP3 ...).
  • Click "Set Config".
  • Instruct the subject as described in the section below.
  • Click "Start".
  • The recording will finish automatically. If you want to acquire more data, just click "Resume" as often as you like.
  • Finally, click "Quit" to leave BCI2000.

Subject instruction

During the initial session, the subject's screen will either be blank, or displaying an arrow pointing up, down, left or right.

  • When a left or right arrow is displayed, imagine movement of the respective hand. The imagined movement should be continuous opening and closing of the hand, similar to rotating a tennis ball in one's hand.
  • When an up arrow is displayed, imagine simultaneous movement of both hands. This should be the same kind of movement as described for a single hand.
  • When a down arrow is displayed, imagine movement of both feet. The movement should be similar to the one described for hands, i.e. imagine opening and closing your feet as if you could use them to grip an object.
  • When you see a blank screen, please relax and stop any movement imagery.

Analyzing the Initial Session

In order to identify a subject's mu rhythm, the EEG signal amplitude must be correlated with the type of imagination that the subject performed during the recording. You will use the BCI2000 Offline Analysis tool for this purpose.

Generating a Feature Plot

As a first step of data analysis, data is separated into amplitudes at individual frequencies and locations. These amplitudes are called features, and their correspondence with the subject's imagination will be plotted as a so-called feature map. From a feature map, it is possible to read off frequency and location whose amplitude is maximally correlated with the subject's imagination. These are optimally suited to provide brain signal feedback in a BCI experiment.

To generate a feature plot from the initial session's data, perform the following steps:

  • Start the BCI2000 Offline Analysis tool:
    • If you have a version of Matlab installed, run tools/OfflineAnalysis/OfflineAnalysis.bat.
    • Otherwise, follow the instructions provided here.
  • In the Analysis Domain field, choose Frequency.
  • In the Acquisition Type field, choose "EEG".
  • As a Spatial Filter, choose "Common Average Reference (CAR)".
  • Enter states.StimulusBegin == 1 into the Trial Change Condition field.
  • Into the field labeled Target Condition 1, enter states.StimulusCode == 0.
  • Enter the word "Rest" into the field labeled Target Condition Label 1.
  • Similarly, enter states.StimulusCode == 2 into the Target Condition 1 field, and "Right Hand" into Target Condition Label 2.
  • Click the "Add" button located besides the Data Files field. A file chooser dialog will appear; navigate to data/<SubjectInitials>001, and select all .dat files available there (use your keyboard's ctrl button to click-select multiple files), then click the dialog's "Open" button.
  • Click "Generate Plots", and wait for the feature plot to appear.

Once the computation is complete, you will see a feature plot similar to the one below. In that plot, the horizontal axis corresponds to frequencies, and the vertical axis corresponds to individual channels. Color codes represent r-squared values; these are numbers between 0 and 1, providing a measure for the amount to which signal amplitude is determined by the subject's imagination.

Typically, there will be clusters of large r-squared values in the feature plot. In principle, picking the largest r-squared value from the map, and using its frequency and channel to configure the online system, would be sufficient. Still, it is important to check whether the signal in question is consistent with the mu rhythm's known properties. This way, it is possible to avoid misconfiguration due to EEG artifacts, other noise, or random effects.

Generating Spectra and Topography Plots

  • Pick the four largest r-squared values from the feature map between 9 and 36Hz, and read off their frequencies and channels. The plot's "Data Cursor" tool (Data Cursor from the Tools menu) may be helpful with this.
  • In the analysis program's Spectra Channels field, enter the channel numbers you read off the feature map.
  • Click the Generate Spectra button. (Available in future versions of the Offline Analysis tool.)
  • In the Topo Frequencies field, enter the frequencies you read off the feature map.
  • Click the Generate Topos button. (Available in future versions of the Offline Analysis tool. In the current version, click "Generate Plots".)

The generated topography plots display the spatial distribution of r-squared values. For right-hand movement imagination, there should be a clear maximum of r-squared values over the left motor cortex, as displayed in subfigure (A) and (B) above. The generated spectra plots display amplitude distributions, and r-squared measure, over frequencies. Ideally, they should appear similar to the (C) and (D) subfigures above.

Analyzing Remaining Conditions

Up to now, you performed an analysis of how imagined movement of the Right Hand is correlated with brain activity. In order to choose the most useful channel and frequency for online feedback, perform similar analyses for the remaining conditions:

  • In the analysis program's Target Condition 2 field, enter states.StimulusCode == 1, and Left Hand into Target Condition Label 2.
  • Make sure the Overwrite existing plots check box is unchecked.
  • Click Generate Plots to create a feature plot for imagined movement of the left hand.
  • As previously, pick the four largest r-squared values, and compute spectra and topographies for their channels and frequencies.
  • Results should be similar to right hand results, except that modulated activity should originate from the right rather than the left motor cortex.
  • Repeat the analysis for conditions states.StimulusCode == 3: Both Hands, and states.StimulusCode == 4: Both Feet.
    • For the both hands condition, the result should resemble a combination of left hand and right hand results.
    • For both feet, modulated activity should be centered around electrode Cz.

Picking Optimal Features

By now, you should have identified a number of maximum r-squared values for each condition, and you should have some impression how plausible corresponding channels and frequencies are.

  • Remove all implausible maxima from your list.
  • From the remaining entries, pick the one with the largest r-squared value. Note this entry's frequency and electrode name, and the subject instruction (condition) that is associated with it. These are the parameters that you will use to configure the online system.

Next Step

Configuring Online Feedback shows you how to configure the BCI system using the parameters obtained in the analysis.

See also

User Tutorial:Mu Rhythm BCI Tutorial