User Tutorial:Performing an Offline Analysis of ECoG Data

From BCI2000 Wiki
Jump to: navigation, search

In this section of the tutorial, we will take you through the steps for performing a frequency-domain analysis of data recorded using an ECoG. Regardless of the selected recording technique, we expect the basic properties of the Mu rhythm to be identical for all humans, while the rhythm's spatial pattern and exact frequency range will differ. As in User Tutorial:Performing an Offline Analysis of EEG Data, we will use BCI2000 Offline Analysis to help determine the frequencies and locations that best facilitate response classification for online control.

Experimental Design

This tutorial will make use of the ecog1_1.dat, ecog1_2.dat and ecog1_3.dat sessions that are included as part of the supplementary sample files downloadable here. Please download this file and extract the contents to data/samplefiles/.

In the ecog1 sessions, the subject was asked to move each hand in a predefined pattern. The resulting data was recorded using BCI2000 and labeled using the StimulusCode state variable such that TargetCode is equal to 1 when the subject is responding to the instruction to move his/her left hand, 2 when the subject is responding to the instruction to move his/her right hand and 0 when the subject is responding to the instruction to rest. If you are relatively new to BCI2000, you may find it helpful to inspect the data files we'll be using with the BCI2000 Viewer. Using this tool, you will be able to see how state variables change with respect to the data over time. For instruction on how to inspect data using the BCI2000 Viewer, please see User Reference:BCI2000Viewer.

The Results

In User Tutorial:Performing an Offline Analysis of EEG Data we manually entered all the analysis parameters. In this tutorial we will make use of the BCI2000 Offline Analysis "Load Settings" feature that allows us to load previously saved settings. In order to load the settings for this tutorial, please do the following:

  1. Open BCI2000 Offline Analysis. If this is your first time using BCI2000 Offline Analysis, you may want to review the instructions on how to install and run this application: User Reference:BCI2000 Offline Analysis.
  2. Click the "Add" button next to "Data Files" and navigate to data/samplefiles/. From there, select the files ecog1_1.dat, ecog1_2.dat and ecog1_3.dat and click "Open". To select multiple files, you'll need to first click on any one file and then, while holding down the control button on your keyboard, click the remaining files. If these files aren't present, please download the supplementary sample files and extract them to data/samplefiles/.
  3. Click File>Load Settings
  4. Navigate to data/samplefiles/
  5. Double-click or otherwise open ecog1Analysis.bws

Now, click "Generate Plots". Once your analysis is complete, you will see feature, spectra and topography plots similar to those below:




In designing this analysis, we followed a similar procedure to the procedure outlined in User Tutorial:Performing an Offline Analysis of EEG Data. We begin by looking for clusters of high r-squared values. Again, these clusters are typically the first indication that the frequency/channel pairs that comprise the cluster may be good features for online analysis. In the generated feature plot, we see that one of the clusters with the highest r-squared values is centered around (25 Hz, Channel 14). So, we continue by creating a topography at 25 Hz and a spectra for channel 14. In the previous tutorial, we used these plots to evaluate the physiological plausibility of this response. We first note that there are significant changes in the spectra between movement and rest. Also, the most significant of these changes occur around the beta frequency range. When inspecting the topographies resulting from the EEG-based analysis, we were able to relate the spatial response to areas of the motor cortex known to control the muscle being moved. We can do this in ECoG as well. In this case, however, the location of an electrode will differ based on where the grid was placed. We must also be aware that an ECoG grid is subject to shifts in position over time. Because the above response is related to movement of the right hand, we expect the response to appear over the motor cortex of the left-hemisphere. There are, however, many reasons why this may not be the case. One simple reason is that the subject may not be performing the requested instruction. Regardless, it is reasonable to conclude from our analysis that (25 Hz, Channel 14) may be an effective feature for use in an on-line recognition task.

See also

User Tutorial:Obtaining Mu Rhythm Parameters in an Initial Session