P300 Off-line Analysis Tutorial

From BCI2000 Wiki
Revision as of 15:41, 14 May 2011 by Mellinger (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Starting an Analysis Session

Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do.

If the recording session runs smoothly, you should now have eight files named TestSubjS001R01.dat to TestSubjS001R08.dat, in the folder c:\bci2000\data\Mu\TestSubj, corresponding to the eight runs, respectively.

Before you start the analysis you should locate, on your hard disk, the correct montage file. This is a file that describes the list of channels that were acquired. In this tutorial we will use OneAndOnly_16ch.eloc.txt, which is located in the folder C:\BCI2000\Tutorial\Montages\. If you need to edit the *.mmf file, check its data format.

Opening Files with Mario

After having run mario.exe, press "Select Data Files".

P300 1.jpg

A dialog window will ask you to select the dat files. You can either select a single data file, or select multiple files. This time, we will select all files in the dataset.

A green box will surround the Raw Data box in the main window.

As an optional (but recommended) operation, click on the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel and allow you to apply spatial filters that depend on the electrode position.

You can load an additional parameter file with choices different from those used in the experiment.

At this point, you can check that P300 is selected in the Analysis menu (indicating that a P300 dataset has been recognized) and select the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button that you can use to select the channels you want to include in your analysis.

Selecting Channels

When you select the EDIT CHANNEL LIST button, two forms will show you the channel list (valid ones and not-valid ones) and an image showing valid channels and their location.

Clicking on Add and Remove buttons allows you to move a channel from one list to the other enabling or disabling it.

Selecting the Spatial Filter

Return to the main window to choose which filter to apply for your analysis, selecting from the following filter choices:

  • RAW
  • CAR
  • Large Laplacian
  • Small Laplacian

Common Average Reference (CAR) will be fine for most of the situations.

We hope soon, to release a user defined solution for any custom analysis.

Feature Extraction Analysis

The Analysis field in the Feature Extraction panel will appear automatically depending on the files loaded. The Feature Extractor field shows the only currently available option (MEM). You can view/edit analysis details by clicking "Set Analysis Details"

P300 2.jpg

This form reports all the remaining settings for the P300 analysis. Most of the values are set as default values. With settings such as the ones reported in this figure, the analysis software will:

  • sample the spectrum at points starting from 0.1 Hz to 15 Hz
  • take a 650 ms long epoch of data.

You can modify these settings according to your aims. When you are finished, remember to confirm your choices by clicking on DONE. It will allow the program accept changes.

At this point you can start the analysis by pressing the Evaluate and Plot button.

P300 3.jpg

View results

The first figure that appears is the R-square matrix (channels x elapsed time after stimulus)

R-square Matrix

The r-square matrix highlights the most relevant ERP features for the separation of potentials due to frequent or rare stimuli.

P300 4.jpg

Each row of the matrix is related to a single channel, while a column represents a fixed latency. The color codes the statistical significance of the difference between the two kinds of evoked potentials.

Thus a red color would mean that the ERP consequent to a rare stimulus is significantly more positive than the ERP consequent to a frequent stimulus.

This figure is independent of the channel and latency settings that were set in the parameter dialog (since it summarizes all results).

Clicking on the matrix will modify the channel/latency settings for the other figures; in fact the cell of the matrix that was clicked is characterized by one channel and one latency, whose waveform and topography (respectively) will be shown in the other two figures.

You can choose whether to overwrite or to put the most recently evoked figures beside the previous one. Two sets of waveform/topography figures are available, and are linked to the click of the left or right mouse button.

Clicking on any point of map will open four more windows:

  • Amplitude waveforms at selected channel(s)
  • Topographic plots at selected latency(ies)
  • ERP response to each stimulus
  • An off-line prediction of the string read

Amplitude Waveform

The whole timecourse of ERPs generated are displayed in the top panel, regardless of the specific stimulus (line of letters) that generated it. Rare ERPs are plotted in solid lines, while frequent ERPs are dotted. If two channels were selected in the P300 parameter dialog, they are plotted in red and in blue, respectively.

P300 5.jpg

The bottom panel shows the r-square time course. It is roughly proportional to the difference between rare and frequent ERPs, but since r-square is sensitive to the dispersion (variance) of single trials, small differences in amplitude can result in a high r-square, if they are very reproducible.

Topographic plots. This figure represents the scalp distribution of the r-square.

P300 6.jpg

The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. With Surface Laplacian spatial filteriing, the number of channels shown on the scalp may not coincide with the whole number of electrodes, since the value of the laplacian is not computed on the border channels.

ERP Response

P300 7.jpg

The figure shows the medium temporal course for the 12 stimuli. Red graphs are rare events while blue ones are frequent events.

String Prediction

Mario also allows you to check the word that the BCI2000 system would have predicted if the current feature was used online.

P300 8.jpg

In this example, since the sequence should have been SPELLWITHBCI, only 4 characters out of 12 (33%) have been correctly predicted. This score is well above chance, though quite inefficient.


S P E L L W I T H B C I
4 M E L L 4 _ T A K G 4


In summary, we must select the latency and the channel where the maxima of an ERP component, whose spatio-temporal shape is compatible with the P300 phenomenon, occurs. Testing the speller can suggest which component has the highest probability to predict the user's selected letter.