BCI Viewer and offline analysis

Forum for discussion on different user applications
Locked
emily
Posts: 40
Joined: 24 Mar 2008, 06:13

BCI Viewer and offline analysis

Post by emily » 09 Jun 2008, 04:42

Hello,
I'm trying to analyse the data from an initial Mu session by following the instructions from Obtaining Mu Rhythm Parameters in an Initial Session tutorial. I've completed the tutorial and have the dat file however I am unsure of the settings for the Offline analysis as these are different to those in the Performing an Offline Analysis of EEG Data user tutorial.
The tutorial recommends that you check the intertrial interval in BCI viewer however this check box does not come up when I look at my .dat file. It does when I look at the sample files eeg1_1.dat.

I am using the generic user tutorial initial session, where the participant must either imagine movement of both hands, or both feet, or either hand. Would you be able to tell me what I need to put in the Target Conditions and in the Trial Change Condition.

Thanks,
Emily

josh
Posts: 14
Joined: 07 Apr 2008, 19:52

Re: BCI Viewer and offline analysis

Post by josh » 09 Jun 2008, 12:45

Hi Emily,
The state variables and parameters are subject to change depending on the version of BCI2000 you use and the paradigm of the experiment. So, we recommend using the BCI2000 Viewer tool to see what state variables are available. Then, by inspection of the behavior of these variables, you will typically be able to determine which variable would be useful for constructing the various conditions. For example, if you look at the sample data (eeg_1.dat) in the viewer and turn on (check the box next to) IntertrialInterval, you will notice that it becomes 1 after the trial is over and 0 again at the beginning of the next trial. So, it is useful for conveying to the OfflineAnalysis tool how to separate the signal into trials. Now, if you load your file into the viewer and check StimulusBegin, you will notice similar behavior. Specifically, that there is a change of value at the beginning of a trial. Thus, StimulusBegin would likely be your best choice for helping OfflineAnalysis to break your signal up. So, in OfflineAnalysis, you'll want to use the following for your Trial Condition: "states.StimulusBegin == 1". Now, if you check the box next to StimulusCode, you will notice that its value corresponds to the stimulus being presented at each trial. So, if we wanted to compare left hand vs. right hand in a typical stimulus presentation task, we would use the following conditions: "states.StimulusCode == 1" and "states.StimulusCode == 2". Hope that helps. Let me know if you have any other questions.

- Josh

emily
Posts: 40
Joined: 24 Mar 2008, 06:13

Post by emily » 10 Jun 2008, 21:47

Hi Josh,

Thanks that worked I’m able to view the .dat files now. I’m still confused though, I thought the idea was to compare rest with imagined or real movement to see where the greatest difference was and from that you could pinpoint the best spot to train mu?

Is there any where I can find out what number corresponds to what state for example is 0 rest, 1 right hand, 2 left hand, 3 both hands and 4 both feet.

If I do compare say 0 with 1 I get totally different results from when I compare 0 with 2 or 0 with 3.

So hypothetically which comparison would I use to decide on training electrodes and centering? Or is there some way I can compare rest with all of the other movement conditions at once?

Thanks for you help,
Emily

josh
Posts: 14
Joined: 07 Apr 2008, 19:52

Post by josh » 12 Jun 2008, 13:35

Hi Emily,
I'm going to put my responses inline. Please see below:
I’m still confused though, I thought the idea was to compare rest with imagined or real movement to see where the greatest difference was and from that you could pinpoint the best spot to train mu?
You are certainly correct that it is typically useful to compare some actual movement against rest in an attempt to find good features. However, it is sometimes possible to get better results by comparing one movement against another. This is true of actual and imagined movement. Consider an experiment where the subject was asked to rest for stimulus 0, move his/her left hand for stimulus 1 and move his/her right hand for stimulus 2. In this case, we might expect the right motor cortex to "light up" with left hand movement (StimulusCode==1) and the left motor cortex to "light up" with right hand movement (StimulusCode==2). If the user rests (StimulusCode==0), we probably wouldn't expect anything to "light up." Because the responses for right and and left hand movement have "opposite" responses so to speak, we might expect the contrast, thus the r^2, between StimulusCode==1 and StimulusCode==2 to be greater than the contrast between StimulusCode==1 or 2 and StimlusCode==0. Ultimately, every person is different, so these expectations might not always be met. Regardless, it is always useful to try different comparisons in your attempt to find the best feature. This is what Offline Analysis is all about.
emily wrote: Is there any where I can find out what number corresponds to what state for example is 0 rest, 1 right hand, 2 left hand, 3 both hands and 4 both feet.
BCI2000 is incredibly general and was built this way to be able to handle the standard paradigms as well as many others that have not yet been thought up. So, it is completely up to you which action should be linked to a given stimulus. That said, the standard stimulus presentation task has 5 different stimuli: Blank Screen (StimulusCode==0), Left Arrow (StimulusCode==1), Right Arrow (StimulusCode==2), Up Arrow (StimulusCode==3), Down Arrow (StimulusCode==4). Although you - as the experimenter - can link these stimuli to any action you choose, it is typical to use rest, left hand, right hand, both hands and both feet respectively. As I mentioned previously, BCI2000 will let you modify the stimuli used and can incorporate different visual and aural stimuli. For more information on that, check out the documentation for the stimulus presentation module: http://www.bci2000.org/wiki/index.php/U ... tationTask
emily wrote: If I do compare say 0 with 1 I get totally different results from when I compare 0 with 2 or 0 with 3.
Hopefully it is now clear why this is happening
emily wrote: So hypothetically which comparison would I use to decide on training electrodes and centering? Or is there some way I can compare rest with all of the other movement conditions at once?
So, the best feature really depends on the individual. What you will want to do is try different comparisons: rest vs. left hand, left hand vs. right hand, both hands vs. both feet, etc... You can probably avoid comparisons like right hand vs. both feet, but it may even be possible to achieve good r^2 results using these conditions. Unfortunately, there's no way to generate all these results at once. The best practice is probably to generate and save the plots for all of the different comparisons (e.g., right hand vs. left hand) that you think might return good results and then compare to find the best r^2 values for the most reasonable features. The newest version of OfflineAnalysis has a feature to make it easy to save all of your feature plots to PDF files. So, if you haven't downloaded that yet, it might be worth it.

Hope this has been helpful. Good luck with your research.

- Josh

emily
Posts: 40
Joined: 24 Mar 2008, 06:13

Post by emily » 22 Jun 2008, 09:54

Thanks Josh,
Helped a lot, but I have more questions sorry.

1. Is there any benefit to having 2 channels for feedback in the 1D cursor with 2 target task. eg. entering the following in the linear classifier
C3 12Hz 2 .5
C4 25Hz 2 .5
or are you better off just using one feedback channel for the 1D task?
C3 12Hz 2 1

2. If the best feature (frequency & location) changes over sessions doesn't that mean what you are training also changes over sessions? How can participants learn when they are potentially being trained to control different frequencies in different locations over the different sessions?

thanks very much,
Emily

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

configuration ...

Post by gschalk » 22 Jun 2008, 14:19

Emily,

You are asking very good and related questions. Unfortunately, they are difficult to answer. They reason why they are difficult is that the brain is adaptive, and not simply producing a particular signal. If it were not adaptive, and knew the characteristics of the signal, we could determine whether we should give feedback from C3 or C4, or both, and we could make many other optimizations. Because the brain is adaptive, and every person is different, you need to adapt your classifier to each person. This is the best answer for the first question I have, but it clearly answers the second. Yes, you need to change features over time if offline analyses indicate that better features can be found elsewhere. However, I would only make these changes if the better features are stable for at least 2 sessions or so, and I would never make radical changes. What you want to do is to help shape the subject produce the best control possible. They will get confused if you change things around too quickly.

I hope this helps.

Gerv

emily
Posts: 40
Joined: 24 Mar 2008, 06:13

It's working!!!

Post by emily » 01 Jul 2008, 23:57

Dear Gerv, Juergen and Josh,
Thanks for your prompt and helpful replies to my endless questions. The training on the 1D cursor task is going well :) . I can now see why using more electrodes is beneficial but I'll have to stick with the 16 for this project.

One of my participants was at 80% accuracy after 3 sessions. I'm just hoping they don't reach 100% too soon as the project requires they complete 8 sessions!

I'm sure I'll still have questions so you haven't heard the last of me :wink: , but I wanted to share the good news and thank you for all of your assistance.

cheers,
Emily

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

Success

Post by gschalk » 02 Jul 2008, 04:33

Emily,

This is terrific. Congratulations!

Gerv

Locked

Who is online

Users browsing this forum: No registered users and 1 guest