User Tutorial:Obtaining P300 Parameters in a Calibration Session

From BCI2000 Wiki
Jump to navigation Jump to search

Obtaining P300 Parameters in the Calibration Session

Although the basic properties of the P300 evoked potential are the same for all individuals, the response's latency, width, and spatial pattern varies, and adaptation to individual parameters improves accuracy.

Thus, it is necessary to obtain these individual parameters prior to performing spelling experiments.

Design of Calibration Session

During the calibration session, the subject is asked to spell out a given word by using a P300 character matrix, pictured below. During each run, the subject is asked to focus on the next letter in the word he is spelling, as the rows and columns flash randomly and successively so that sometimes the flashing corresponds to the column or row containing the target character and sometimes it will not. As the subject counts the number of times the desired letter in the word flashes, a P300 response is generated. In our example, each letter will flash 30 times in total (15 rows and 15 columns). The purpose of the calibration session is to identify those features that discriminate between the desired and undesired rows/columns. Without that information, it is impossible to interpret the subject's brain signal. Thus, do not expect any correct letter selection during the calibration session.

P3SpellerMatrix.PNG

After the first few runs are collected, we will use the BCI2000 "Offline Analysis" tool to determine which features (in this case, signals at a particular location and time after the stimulus) correspond to the row or column of the desired character.

Performing the Calibration Session

  • Start BCI2000 by running batch/P3Speller_<Your_Amplifier>.bat
  • Press Config, and load the baseline parameters for copy spelling that you made earlier.
  • In the Storage tab:
    • Set SubjectName to the subject's initials.
    • Set SubjectSession to 001
    • Set SubjectRun to 01
  • In the Application tab:
    • Make sure that InterpretMode is set to copy mode, and DisplayResults (directly below InterpretMode) is unchecked
    • Find the TextToSpell field. This should be set to ‘THEQUICKBROWNFOX’, and you will be changing it after each run.
  • Press Set Config to apply this configuration.
  • Request that the subject sit in a relaxed position, and that the subject not move or speak during the runs.
  • Turning off or dimming the lights can improve the subject's focus and performance.
  • Showing the brain wave readouts to the subject can help understanding how artifact-generating behavior can be detrimental to the data.


RecordingEnd.PNG


  • Press Start to show the flashing character matrix, and describe what the subject is expected to do.
  • After you’ve explained the procedure, click Suspend to stop.
  • Delete that run of data (the file will be found at data\P300\<Subject Initials>001\<Subject Initials>S001R01.dat).
  • Press Start to record the run.
  • Once this recording has finished, close BCI2000 and locate the saved data files below the BCI2000 data directory.

Analyzing The Calibration Session with Offline Analysis

We will now use the BCI2000 "Offline Analysis" tool to analyze the subject's initial session.

  • Start the BCI2000 Offline Analysis tool:
    • If you have a version of Matlab installed, run tools/OfflineAnalysis/OfflineAnalysis.bat.
    • Otherwise, follow the instructions provided elsewhere.
OfflineGUI.PNG
  • In the Analysis Domain field, choose Time (P300)
  • In the Acquisition Type field, choose EEG
  • Next to Spatial Filter, choose Common Average Reference (CAR)
  • For Trial Change Condition enter auto
  • For Target Condition 1 enter (states.StimulusCode > 0) & (states.StimulusType == 1)
  • For Target Condition Label 1 enter Attended Stimuli
    • ‘Attended Stimuli’ refers to the letter or character the person is counting the flashes of, and triggers when the desired letter is flashed
  • For Target Condition 2 enter (states.StimulusCode > 0) & (states.StimulusType == 0)
  • For Target Condition Label 2 enter Unattended Stimuli
    • ‘Unattended stimulus’ refers to the letters or characters the person is not counting the flashes of, and triggers when the desired letter is not flashed
  • Click the Add button by Data Files
  • In this new dialog, select all of the data files taken during this configuration session, and click Open
  • Click Generate Plots and wait for the feature plot to appear
FeaturesPlot.PNG
  • When this is complete, you will see a feature plot similar to the one to the right. The vertical axis corresponds to the locations while the horizontal corresponds to the time delay after the stimulus. The color coding shows the r-squared value of that datapoint, with dark red colors indicating a high predictability that a response is produced by the desired letter being flashed.
  • The largest of these r-squared values between 250 and 550ms are what we are interested in. Pick 2-4 points with the largest r-squared values between these times and record their time points and channels. The plot’s Data Cursor tool (Tools Menu → Data Cursor) allows for discrete identification of time points.
  • With these points, close the feature plot, and enter the channels of the data points you found into the Waveform Channels field and the time points into the Topo Times field.
    • In the example above, three data points have r-squared values 0.032, 0.055, and 0.021, occur at times 250ms around channel Po7, Po8, and Oz. 6, 7, 8 would be entered into Waveform Channels and 250 would be entered into the Topo Times field.
  • Click Generate Plots to create the features plot again with a set of three graphs that show the correlation between the selected times after the desired stimulus is given (the red line) and the brain’s responses to when the desired stimulus is not given (the blue line). Topographies is also given at 250ms.
    • As seen below, the attended-stimulus reaction will typically be stronger than for the unattended stimuli, but in some cases the reverse is true. If the ‘unattended’ curve is larger than the ‘attended’ curve then make a note of this before moving on. The waveform seen here is similar to the others generated, only one is shown here for simplicity.
    • Additionally before moving on, determine the location of the response seen. The P300 response is generally observed centered on the Cz electrode, or just behind and directly in between the ears (example below), and does not involve the frontal regions of the brain. Assuming these characteristics are present, it is proper to proceed.
Waveform.PNG


P300Classifier

The use of the "Offline Analysis" program was provided to familiarize you with the characteristics of the P300 response. The feature graph above inspects the quality of the Calibration Session. Once the results above seams reasonable, we can obtain a subject specific parameter file using the P300Classifier under the tools/P300Classifier folder. This stand-alone program determines optimal features (i.e., signal times and channels) and corresponding weights automatically, and outputs those in a classifier matrix. Use of this program streamlines the configuration process at the expense of decreased hands-on experience with BCI data and the BCI2000 program itself.

For instructions on using the P300Classifier, see User Reference:P300Classifier.

Next Step

To continue onto performing P300 spelling experiments, continue to Performing a P300 Spelling Session.

See also

User Tutorial:P300 BCI Tutorial