Forum for software developers to discuss BCI2000 software development
-
marialaura
- Posts: 8
- Joined: 01 Apr 2008, 03:45
Post
by marialaura » 15 May 2009, 05:28
Hi,
I'm trying to use the BCI2000 as a trigger for my EEG system. I mean when the stimulus begins it should toggle the state of one pin on the Biosemi parallel port.
Everything works well...the only thing still not clear is the timing.
Why if I set
- presequence=30sec
- postsequence=30sec
- StimulusDuration=1sec
- etc
I can see that the presequence is actually at 44sec? In this way the session is long more than 2min instead of 1min as I would.
While if I turned off the Biosemi, and run the signalgenerator alone (same value for the parameters above) everything is synchronized as I would
Thanks,
ML
-
gschalk
- Posts: 615
- Joined: 28 Jan 2003, 12:37
Post
by gschalk » 15 May 2009, 10:40
MariaLaura,
The fact that the timing is good without the application driven by the AppConnector, and not good with that program, tells me that the program that does the parallel port stimulation slows down the whole system. (We know that using the AppConnector with other AppConnector-driven programs works just fine.)
In general, why do you need to use a Biosemi data acquisition software and a parallel port trigger? This is exactly the kind of situation that the use of BCI2000 should avoid. If there is still a problem with the Biosemi source module, shouldn't we try to get this worked out instead?
Gerv
-
marialaura
- Posts: 8
- Joined: 01 Apr 2008, 03:45
Post
by marialaura » 18 May 2009, 04:47
Thank you very much for your feedback.
Unfortunately the Biosemi can communicate with the external world through the parallel port.
Regarding the module for Biosemi I'm still working on the bugs..
best regards, ML
-
gschalk
- Posts: 615
- Joined: 28 Jan 2003, 12:37
Post
by gschalk » 18 May 2009, 07:33
MariaLaura,
I understand that Biosemi can only communicate via the parallel port, but I do not understand why the Biosemi system needs to do anything other than acquiring data. In case you would like to describe what you are trying to do, I would be glad to make suggestions if I can.
Gerv
-
marialaura
- Posts: 8
- Joined: 01 Apr 2008, 03:45
Post
by marialaura » 19 May 2009, 06:04
Thank very much, Gerwin.
Well, I want to run a sensory paradigm. The trigger to the Biosemi will mark the time when the operator start to stimulate the suject's hand (the operator starts when he will hear the stimulus comes from BCI2000). In this way I will know the begin and the end of the stimulus and from these points I can easily segment the recorded EEG and extract the ERP.
bye ML
-
gschalk
- Posts: 615
- Joined: 28 Jan 2003, 12:37
Post
by gschalk » 19 May 2009, 07:04
MariaLaura,
I am sorry, but I am still confused. From what I understand, you would like to look at sensory-evoked ERPs. To do this, you have an operator stimulate the subject's hand. The operator begins to stimulate when he hears/sees a stimulus presented by BCI2000.
It seems from your description that the best trigger for this ERP is the time of stimulus presentation in BCI2000, which of course is stored along with the data file in the state StimulusCode. You can load the BCI2000 data file into Matlab, or convert it into ASCII for further processing.
If you do need some external trigger for some reason, you could also use a keyboard (e.g., the operator pressing a key when he/she starts to stimulate), mouse, or a joystick, all of which are supported by BCI2000.
It is also possible that your stimulation device has an output and that you need to record this output in some fashion. In this case, I can see why you may want to use the parallel port on the Biosemi system. Just so you know: It would be relatively straightforward to write a parallel port logger for BCI2000 (just like the keyboard logger) that would log the parallel port directly within BCI2000.
Gerv
-
marialaura
- Posts: 8
- Joined: 01 Apr 2008, 03:45
Post
by marialaura » 22 May 2009, 06:18
Gerwin,
You understand perfectly what's going on. If I decided to use an external trigger is because the analysis tool I'm currently using read the bdf format that comes out with the biosemi. No other reasons behind my choice.
However, your suggestion is straightforward...I think I will try!
Again, thank you.
ML
-
Marco Rotonda
- Posts: 15
- Joined: 19 Nov 2008, 09:20
Post
by Marco Rotonda » 04 Jun 2009, 21:38
gschalk wrote:the best trigger for this ERP is the time of stimulus presentation in BCI2000, which of course is stored along with the data file in the state StimulusCode. You can load the BCI2000 data file into Matlab, or convert it into ASCII for further processing.
Hi there...
I'm in a quite similar situation with a problem on the state vector (StimulusCode)...
I'm using FieldTrip and Matlab...
If I follow the examples on
http://www.bci2000.org/wiki/index.php/P ... rip_buffer I can really act upon the state vector (the cursor is moving up or down) but in the final .dat file I don't find the state vector marker (the StimulusCode should be 1 or -1, isn't it?)...
If I use StimulusPresentation app., instead, I can find the StimulusCode on the .dat file of the stimuli presented from the app, but not from FieldTrip... the events it presents are not in the state vector?
Sorry I can't understand...
Marco
-
gschalk
- Posts: 615
- Joined: 28 Jan 2003, 12:37
Post
by gschalk » 05 Jun 2009, 06:53
Marco,
It is possible that your problem is due to the fact that your BCI2000 system simply does not request the StimulusCode state. Each state has to be requested by its name and length in bits. This can be done in the constructor of the C++ and also the Matlab interface, as described in the Wiki (although I am not sure about FieldTrip). You can use the Operator to check which states are in your system. You can also try to modify from Fieldtrip one of the existing states in BCI2000. If this works, we can then check how to create a state from Fieldtrip.
Gerv
-
Marco Rotonda
- Posts: 15
- Joined: 19 Nov 2008, 09:20
Post
by Marco Rotonda » 05 Jun 2009, 10:54
gschalk wrote:You can also try to modify from Fieldtrip one of the existing states in BCI2000. If this works, we can then check how to create a state from Fieldtrip.
well I've almost get out... but I found a double "trigger"...
The point was that I thought that FTOutputEventType was the the field to write to the state, whilst it's only for event. The right filed is FTStatesFromBuffer.
Another things is that if I use the app StimulusPresentation it works (and luckely I'm using this one) but if I use FeedbacDemo doesn't write nothing...
Now my only question is about the double markers.
I use 2 stimuli on StimulusPresentation. When the stimuli are presented by the app there are 2 markers (2 and 0 or 1 and 0) but the marker I send from FT are 2 and the same (I use 5 so there are two 5 in the .dat file)...
Which one is correct? Maybe the first but I'm not sure.
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Post
by mellinger » 09 Jun 2009, 03:19
Marco,
I don't understand what you are trying to do.
Do you want to control stimulus presentation from FieldTrip?
Regards,
Juergen
-
Marco Rotonda
- Posts: 15
- Joined: 19 Nov 2008, 09:20
Post
by Marco Rotonda » 09 Jun 2009, 05:38
mellinger wrote:Marco,
I don't understand what you are trying to do.
Do you want to control stimulus presentation from FieldTrip?
Regards,
Juergen
Actually I'm not sending any event to StimulusPresentation to control it. Just sending a code to the state vector, like a trigger...
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Post
by mellinger » 15 Jun 2009, 07:17
Marco,
could you rephrase your question?
Thank you very much.
Juergen
Who is online
Users browsing this forum: No registered users and 0 guests