R2 plots following calibration

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

R2 plots following calibration

Post by kpitt » 07 Jun 2020, 22:02

Hi everyone

Sorry to post again. I was wondering if I could get some feedback on the r2 plots we got following calibration. I attached some of the config details below, but can provide more if helpful. I was wondering,

1) Do you know why on the no ref R2 plot from the BCI2000 offline analysis tool we don't really have any values except for the very high channels, that seem to extend beyond our sourcech value of 33? The R2 plot can be seen here for the CAR and non ref for the offline analysis tool -
R2 plots.jpg
R2 plots.jpg (255.83 KiB) Viewed 2699 times
I attached plots of 2 = Fz, 24 = CZ, 7=FC1, 8=C3, 25=C4 for the no ref setting in the analysis tool, so it seems we have data.
Plots_noref.jpg
Plots_noref.jpg (93.99 KiB) Viewed 2699 times

2) Do you think the R2 values for the CAR plot appear acceptable?

I also attached an image our loc file if helpful, as I have not labelled the BCI2K config file per the 10-20 yet, but just left channel values. -
Config.jpg
Config.jpg (117.1 KiB) Viewed 2699 times
Epochs to average/number of sequences = 20 (we did 8, 4 letter words for calibration)
Epoch length = 500ms
EEG chans = 32
Trigger = 1
Sourcech = 33
ISI = 150ms (min) – 175ms (max)
Highlighting time = 50ms
Sampling = 250 Hz
Block = 16
Full matrix

Thank you!

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 08 Jun 2020, 11:07

HI,

it's difficult to tell what's going on. Actually, the individual curve plots look quite reasonable, but if your channel topography is correct, they can't be. A P300 response would not appear at Fz/F3/F7 and nowhere else. Also, you shouldn't use the additional channels (likely trigger channels) in the r^2 analysis. What source module are you using?

-Jürgen

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

Re: R2 plots following calibration

Post by kpitt » 08 Jun 2020, 17:35

Hi Jürgen,

Thanks for the response! I was a little confused on why you are only noting activity on Fz/F3/F7? I did not see an option on the BCI2k offline analysis tool to exclude any non EEG channels from the R2 plot, so I was thinking that was done automatically and that this just included the 32 EEG chans. We are also planning on recording from an Aux channel (photo diode), and the three accelerometer channels, but have not included those yet.

We are using the brain vision liveamp. I attached a screenshot of our source module, though we are using a block of 16, and using a 60Hz notch filter.
3.Source PNG.PNG
3.Source PNG.PNG (61.87 KiB) Viewed 2683 times
We are going to go into the lab to try out things again tomorrow (Tuesday)

I really appreciate your input on this! Please let me know if I can provide you with any more information.

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 09 Jun 2020, 08:33

Hi,
I was a little confused on why you are only noting activity on Fz/F3/F7?
I read this from your first r^2 plot. It shows a response in channels 2, 3, and 4. From the photograph of your electrode montage, I read that these channels correspond to Fz, F3, F7.
I did not see an option on the BCI2k offline analysis tool to exclude any non EEG channels from the R2 plot, so I was thinking that was done automatically and that this just included the 32 EEG chans.
If you specify a montage file, only channels that appear there are included in the analysis.

I see you have set ChannelNames to 1..33. The meaning of this parameter is to enter channel names, such as Fz, F3, F7 in the order in which they correspond to channels. Naming channels by their numbers is the default, you don’t need to enter anything into ChannelNames if you want this.

TransmitChList is set to 1 2 3 4, this is fine for the calibration session, but you will need to change this for the actual spelling session. You may enter a range such as 1:32 to specify a range of channels.

-Jürgen

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

Re: R2 plots following calibration

Post by kpitt » 09 Jun 2020, 16:12

Hi Jürgen,

Thank you, that was helpful, though we now hit a new barrier. We edited the source file as your recommended (using 10-20 names, setting the transmitchan list to 1:32), and stopped recording from the trigger (sourcech = the 32 EEGlocs), and that seems to have made our plots a bit better. As the waveform plots look good, similar to last time (this is the same participant), I think the fp1 activity is more likely eye related artifact associated with target presentation, unless you have other thoughts? We will see if it persists with a different participant.
plots.png
plots.png (1.83 MiB) Viewed 2664 times
Our new problem arouse when we tried to upload our data to get weights for the classifier for online use. Do you have any guidance on how we should go about trouble shooting this error? We weren't sure whether it had anything to do with our parameters for the linear classifier, which are currently just left as default with 2 rows (below; we are using a full matrix).
Error.png
Error.png (1.14 MiB) Viewed 2664 times
Linear classifier.png
Linear classifier.png (10.35 KiB) Viewed 2664 times
Sorry to bother you again, I really appreciate you time and support with this!

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 10 Jun 2020, 07:20

Hi,
I think the fp1 activity is more likely eye related artifact associated with target presentation, unless you have other thoughts?
I don’t think that you will typically see eye or blink artifacts on one eye but not the other, unless the participant suffers from an asymmetric condition. For a P300 response, the topography is quite irregular. Could you double check whether the associations between channels and electrode locations is correct, e.g. by using a multimeter to test for connection between electrode Cz and plug nr. 24 on the amplifier side? Testing just a few electrodes like this will quickly show errors if something is wrong with your montage information.
Our new problem arouse when we tried to upload our data to get weights for the classifier for online use. Do you have any guidance on how we should go about trouble shooting this error?
Please make sure to use the latest version of BCI2000 and the P300Classifier program (https://www.bci2000.org/mediawiki/index ... on_History).
We weren't sure whether it had anything to do with our parameters for the linear classifier, which are currently just left as default with 2 rows (we are using a full matrix).
The linear classifier configuration is not used in the calibration session, so it does not matter.

-Jürgen

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

Re: R2 plots following calibration

Post by kpitt » 13 Jun 2020, 12:06

Thanks for the support Jürgen, I really appreciate it and we are looking forward to having BCI2000 running!

Regarding the classifier, we are using BCI2000 version 3.05, which from what we can see was the most recent stable version. If there another version of the P300 classifier we should be using? We got some more data in the lab last week, and calibrated on 20 letters, with 20 for number of sequences and epochs to average. However, unfortunately we still got the same error as last time that the classifier was unable to generate usable weights. I attached some images below, do you have any thoughts on how we can fix this?

We have been looking at the locations and not found any errors yet. We got data on a different participant last week (below), and things looked a bit better topography wise, though we still have some laterality it the neck area. We will do some more processing on the data. Just to clarify, we are using the face speller (semi transparent faces) with a right ear lobe reference. We are planning to add the other ear lobe reference in during later, during offline/post session processing/analysis.

I hope your weekend is going well.
Version.png
Version.png (524.03 KiB) Viewed 2616 times
Classifier.png
Classifier.png (1.45 MiB) Viewed 2616 times
Plots copy.jpg
Plots copy.jpg (284.8 KiB) Viewed 2616 times

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 15 Jun 2020, 11:03

HI,

your r^2 topographies look really weird, but then r^2 values are very small as well, so the topographies could be just random artifacts, resulting from a slight correlation of muscular artifacts at forehead or neck with the target stimulus.

It might be a good idea to try the standard P300 speller before switching to the variant with semitransparent images, just to make sure that your EEG apparatus and software both work as they should.

Regards,
Juergen

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

Re: R2 plots following calibration

Post by kpitt » 19 Jun 2020, 22:56

Hi Jürgen,

So, good news. We went into the lab last week, changed a few settings, and tried a new subject and things worked well! Even better with the facespeller. I was actually able to get pretty high online spelling accuracy using the facespeller with only 2 sequences, which I thought was good. So, now we are on to the next task we thought you may have some guidance on.

Firstly, we are trying to establish whether we should collect data from a photodiode to improve later offline data analysis. So, we used a photodiode to evaluate the timing differences between BCI2000 markers and screen intensification. We are using a Dell Latitude 5500 with a dedicated video card. We found that there was a 56 and 88 ms delay between the marker and the photo sensor. We thought this delay could be to the wireless data collection of the livemap, but we were going to try again with a different monitor, and maybe also increasing the sampling rate from 250 to 500Hz to see if it makes a difference. Anyway, we were wondering what you or others had found regarding differences between the BCI2000 markers and the photo sensor for our reference.

Also, is there any code that we could use to quickly calculate performance accuracy and ITR utilizing the output files BCI2000 provides, or do you have any suggestions on the most efficient way to track/calculate performance measures with BCI2000?

Thanks again for all your help Jürgen, you have really helped us make progress!

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 22 Jun 2020, 10:04

Hi,
We found that there was a 56 and 88 ms delay between the marker and the photo sensor.
BCI2000 provides multiple "markers" to document different stages of stimulus presentation. When analyzing data, you can use
  • StimulusCode != 0
  • value of StimulusTime timestamp
  • value of PresentationTime timestamp
The first method is the least exact one, because it only operates on block boundaries. Also, the "marker" will appear at the beginning of the data block during which the stimulus will be presented. Thus, the delay between "StimulusCode != 0" and actual stimulus onset will be rather large.

The second method is to take the value of the StimulusTime timestamp and compare it to the SourceTime timestamp in order to get the time between the current data block’s acquisition time, and the time when BCI2000 queued the stimulus into its rendering pipeline. From, there, it will typically take three to four video frames until the queued stimulus is presented.

The third method is to use the PresentationTime timestamp rather than the StimulusTime timestamp. The PresentationTime timestamp is taken when BCI2000 thinks it has done everything to present the stimulus to the screen. Ideally, this would match the time when the stimulus actually appears on screen, but in reality it does not. Depending upon settings of the graphics card driver, the graphics card may employ another queue of frames of size 1 or 2. In addition, if you use an LCD screen rather than a CRT, the screen requires a buffer of at least one frame to construct the display image before presenting it. If the screen performs image enhancement, additional delay may occur.

Basically, this means that you cannot rely on software-provided stimulus markers if you need precise information about stimulus delay, no matter what software you are using.
For a P300 based speller however, additional delay is not detrimental, provided it is constant (has small variance). The P300 wave has no sharp edges, which means it is not problematic if there is small timing jitter. Also, if you train a classifier on data that has a certain delay between marker and stimulus, and then use the trained classifier with the same physical setup, it will detect the delayed P300 just as well as an undelayed one.

HTH,
Juergen

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

Re: R2 plots following calibration

Post by kpitt » 24 Jun 2020, 09:53

Hi Jürgen,

Thanks for the marker explanation, that was helpful. The main reason we are considering getting data from the photodiode is for post processing ERP analysis. I would like to explore the ERPs a little offline. Therefore, I know making efforts to ensure we can best align the data to what individual is actually seeing/processing is beneficial for post processing analysis. Do you have any guidance on how we would make a small photodiode circle on the display (maybe in the top right corner) that would flash with each row and column presentation?

All the best,

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 24 Jun 2020, 11:35

Do you have any guidance on how we would make a small photodiode circle on the display (maybe in the top right corner) that would flash with each row and column presentation?
This requires a small modification to the C++ source code of the P3Speller module. Basically, one needs to create another stimulus, set its coordinates, and add it to all stimulus groups so it flashes every time. I can guide you but it's going to be difficult in case you have no programming experience.

kpitt
Posts: 10
Joined: 06 Jun 2020, 22:30

Re: R2 plots following calibration

Post by kpitt » 25 Jun 2020, 20:49

Thanks, Jürgen.

I have a couple of computer engineering students in the lab this summer with C++ experience. So, if you would be kind enough to guide them on how to create a small circle for the photodiode, I will have them make a start on that.

All the best,
Kevin

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: R2 plots following calibration

Post by mellinger » 26 Jun 2020, 07:34

OK, fine.
-Jürgen

lmiller
Posts: 4
Joined: 16 Jun 2020, 11:10

Re: R2 plots following calibration

Post by lmiller » 03 Jul 2020, 15:49

Hello Jürgen, I am the student who is working with Dr. Pitt one setting up the BCI2000/photodiode. I have been searching through the source code and I think I have found sections of code that I can connect the photo diode code to. First off, do you know if there are any other relevant files to the p300 that aren't in this image? There are obviously files that relate to the BCI in general, but I couldn't find any other files that relate specifically to the p300 speller application. https://unl.box.com/s/mbxoc0asdz3xf6pnyj3mmkkirle7o4d0

The second piece of code here is, from what I can tell, the best place to tie in the photodiode. I was thinking of tying the photodiode flash after the ++mSequenceCount if statement. Am I correct in this guess, or am I off base? https://unl.box.com/s/qod03qi29w2shh0j2yb4r6ucggvxkngj

Finally, could you point me in the correct direction to learn more about the *.mud file type? I found it referenced several time in the source code, but I could not understand what all information goes into the file.

Thank you for taking time to help me with all of this, I really appreciate it.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests