Problem saving marker in the eeg data

Known Issues and Problems with BCI2000
Locked
ripa
Posts: 9
Joined: 12 May 2014, 05:21

Problem saving marker in the eeg data

Post by ripa » 29 Jul 2014, 11:28

Hi ,

I am using BCI2000 for my experiment.

I am having problem from past one month in sending trigger ( audio stimuli marker) from my experimental task into my BCI2000 PC.

I am running my own application in my Experimental PC which is programmed by MATLAB.

I would like to send the stimuli information via UDP into BCI2000 data. I would like to send the information about audio stimuli whenever it is playing. Example I would like to send 1 for sound 1, 2 for sound 2, so it is like a marker.

the problem is I know how to send the stimuli information as marker via UDP in MATLAB , but I am not sure how to save it with the EEG data.
I have tried to send udp by using matlab function from my experimental pc to connected input filter( app connector ). I verified that my udp communication is working properly. However I am not able to save this data so that I could merge it with my EEG data.How to combined this marker ( coming from connected input filter) in the data so that for example I will have 1to 16 EEG data and 17 channel will be like 1 2 1 1 2 1 ( 1 for sound 1 and 2 for sound 2).

I have specified int8(1) for sound file 1 . Still I was not able to see the new event marker in my .dat file.

Thank you !!!

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Problem saving marker in the eeg data

Post by boulay » 29 Jul 2014, 15:01

I'm sorry this is an incomplete answer, but I'd like to suggest using another input on your amplifier if at all possible because that will give you the best timing synchronization. If timing is not so important, then maybe you can use states instead of signals.

ripa
Posts: 9
Joined: 12 May 2014, 05:21

Re: Problem saving marker in the eeg data

Post by ripa » 30 Jul 2014, 09:28

Thanks a lot Chad :) I was expecting a reply from you !!

Thank you for your reply. I thought the same solution , using parallel to D I/O cable for the direct connection. it is best regarding the time synchronization issue.
I would like to know if I am using the direct connection as input into the amplifier , how Bci2000 will identify it as an another channel. I went through the parallel switch documentation. I found inpout32.dll file also. However I am still thinking the exact procedure of how to use it.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Problem saving marker in the eeg data

Post by boulay » 30 Jul 2014, 11:54

What amplifier are you using? Many amplifiers have a digital input. Exactly how this is recorded by BCI2000 depends on the source module for each amplifier. For the ones I've used digital input on (gtec and BrainProducts), the digital channel becomes another analog channel added after all the normal signals.

ripa
Posts: 9
Joined: 12 May 2014, 05:21

Re: Problem saving marker in the eeg data

Post by ripa » 30 Jul 2014, 12:44

Dear Chad ,

I am also using gtec amplifier and I also have Digital I/O port in my amplifier. I am using matlab prog as my experimental script. Does it require special function to send the sound marker signal through digital I/O port ? I would like to send sound marking message into my amplifier , so that I will have 1-16 EEG data and 17 will be a channel which contains 1 , 2 , 1 , 1 etc... 1 for sound trigger (1) and 2 for sound trigger (2).

Thanks a lot for your help

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Problem saving marker in the eeg data

Post by boulay » 30 Jul 2014, 13:47

I'm sorry, I don't really remember the pinout of the gtec DIO port and I haven't hacked a parallel port in a long time. You'll have to look at the documentation for the gtec DIO port and the computer's parallel port to see how they should be connected. I'm pretty sure gtec sells a cable to do exactly this.

Assuming you have them connected properly, then you'll have to tell Matlab to write to the parallel port at the same time that it plays the sound. From what I remember, writing to the parallel port with Matlab is rather easy. How the gtec amp will interpret these inputs, I don't know, but you can test either by looking at the channel in BCI2000 or maybe even by looking at it in the gUSB Demo software.

By the way, gtec sells a g.TRIGbox that has various input ports and its output goes to the amp's digital input. I believe it has a 3.5mm input for audio. You could splice your audio signal and plug it directly in to the trigbox which will then tell you, on the digital port, exactly when the audio was played. Whether it was sound 1 or sound 2 it cannot tell you. But, to extend this idea, you can separate your audio into 2 channels. Sound 1 will always play on L, sound 2 will always play on R. L will go to one of the inputs, and R will go to another of the inputs of the g.TRIGbox. That should work and will give you better timing than using the parallel port, which is especially important if you plan on doing an ERP study.

Have you considered letting BCI2000 play your sounds?

ripa
Posts: 9
Joined: 12 May 2014, 05:21

Re: Problem saving marker in the eeg data

Post by ripa » 31 Jul 2014, 08:09

Dear Chad ,

Thank you very much for your reply. I figured out where I should put the D I/O cable as well as I found one software eprime by which I can send the trigger. However I still need to research on it.

I am sorry I will use several audio stimuli( at least 7 ) so I was try to sending 7 different marker for each stimuli. In that situation , I think I can't use gTrigbox. I don't have it in my lab and I think it does have that many input port. I will try with the parallel port method. I will try to search a possible best way to send the trigger over parallel port to the amplifier. I will not have enough time to order the gTrigbox because I will run experiment within 1 month. :( . So I think I can only try with the parallel port method. I have created the experimental script so I am running external application so I will be not able stimulus presentation BCI2000 application. yeah one of the major part of my study is ERP analysis so time matter is really important for me.

I have another question , I have some test data ( .mat)and I would like to use BCI2000 for using FILEPLAYBACK mode for using BCI2000 online filter.

I would like to know is there any method to convert my .mat file into .dat file ??

Thanks again for guiding me !!!

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Problem saving marker in the eeg data

Post by boulay » 31 Jul 2014, 09:38

ripa wrote: Thank you very much for your reply. I figured out where I should put the D I/O cable as well as I found one software eprime by which I can send the trigger. However I still need to research on it.

I am sorry I will use several audio stimuli( at least 7 ) so I was try to sending 7 different marker for each stimuli. In that situation , I think I can't use gTrigbox. I don't have it in my lab and I think it does have that many input port. I will try with the parallel port method. I will try to search a possible best way to send the trigger over parallel port to the amplifier. I will not have enough time to order the gTrigbox because I will run experiment within 1 month. :( . So I think I can only try with the parallel port method. I have created the experimental script so I am running external application so I will be not able stimulus presentation BCI2000 application. yeah one of the major part of my study is ERP analysis so time matter is really important for me.
Before you spend too much time with this solution which may be less than ideal, please try setting up your experiment using BCI2000's StimulusPresentationTask module. It should only take you a few minutes to set it up.
ripa wrote: I have another question , I have some test data ( .mat)and I would like to use BCI2000 for using FILEPLAYBACK mode for using BCI2000 online filter.
I would like to know is there any method to convert my .mat file into .dat file ??
Yes, there is. It is a little difficult.
In BCI2000\tools\mex there is a function called "save_bcidat". This will save a (properly formatted) set of signals, states, parameters to a .dat file.
Since your data are not already formatted correctly, you have a little work to do. There are some tools to help you in BCI2000\tools\matlab
For the states and parameters, it is probably best to make a BCI2000 file that matches your test scenario as closely as possible, then load that file into Matlab and edit the variables until they match your test data. If your online processing depends on state variables then please pay careful attention to them.

Locked

Who is online

Users browsing this forum: No registered users and 3 guests