User Tutorial:Performing an Offline Analysis of MEG Data
In this section of the tutorial, we will take you through the steps for performing a frequency-domain analysis of data recorded using an MEG. 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.
This tutorial will make use of the meg1_1.dat session that is included as part of the supplementary sample files downloadable here. Please download this file and extract the contents to data/samplefiles/.
In the meg1_1.dat session, the subject was asked to perform the right justified box (RJB) task - a 1-D task available through BCI2000. For this task, the subject must move a cursor up or down in order to hit a target on the right side of the screen. The cursor begins on the left side of the screen and travels toward the target at a constant speed determined by the operator. In this particular experiment, the subject was asked to open and close his/her left hand to move the cursor up and right hand in order to move the cursor down. The task was controlled using BCI2000 and the data was recorded and labeled using the TargetCode state variable. For trials where the subject was attempting to move the cursor up (i.e., left-hand movement) TargetCode is equal to 1. For trials where the subject is attempting to move the cursor down (i.e., right-hand movement) TargetCode is equal to 2. For intervals between trials (i.e., when the subject is at rest), TargetCode is equal to 0. If you are relatively new to BCI2000, you may find it helpful to inspect the datafiles 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.
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:
- 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.
- Click the "Add" button next to "Data Files" and navigate to data/samplefiles/. From there, select the file meg1_1.dat and click "Open". If this file isn't present, please download the supplementary sample files and extract them to data/samplefiles/.
- Click File>Load Settings
- Navigate to data/samplefiles/
- Double-click or otherwise open meg1Analysis.bws
Now, click "Generate Plots". At this point you will be presented with a message dialog warning you that the number of trials found using the selected datafile is less than 10. In order to sufficiently generalize the response, it is recommended that your data (i.e., all selected datafiles together) comprise at least 10 trials. In some cases, you will not be able to meet the suggested minimum. In that case, you can mark the checkbox labeled "Ignore Warnings" to proceed. Even with this box checked, however, BCI2000 Offline Analysis will halt any analysis where the data comprises less than 3 trials. So, in order to proceed with this single data file, please check the box labeled "Ignore Warnings". Now the BCI2000 Offline Analysis window should look like this:
Click "Generate Plots" once again. Once your analysis is complete, you should 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 on-line analysis. In the generated feature plot, one such cluster is centered around (13 Hz, Channel 4). So, we continue by creating a topography at 13 Hz and a spectra for channel 4. As in previous tutorials, we use these plots to evaluate the physiological plausibility of this response. First note that there are significant changes in the spectra between movement and rest. Also, the most significant of these changes occurs around the mu and beta frequency ranges. From the topography, we see that the response is largely present over the motor cortex of the left hemisphere. Such a response should be expected since the movement occurred on the right side of the body. Therefore, we conclude that (13 Hz, Channel 4) will likely be an effective feature for online control tasks.