Region based paradigm using BCPy2000

Forum for discussion on different user applications
Post Reply
lmbaldezzari
Posts: 8
Joined: 31 May 2015, 09:16

Region based paradigm using BCPy2000

Post by lmbaldezzari » 16 Jan 2016, 10:10

son estas variables las que me permiten


Hi everyone! How are you?

I made my own stimulus presentation using BCPy2000. Up to now, everything work "almost" fine. However, I need to know where the user is watching to determine the target that He/She want to spell.

My system consists of, g.MOBILab like my signal surce, P3SignalProcesing like my processing module and BciApplication.py like the application module.

I know that the processing module consists of several processes and according THIS topic, the OutputStates are, among others, StimulusCodeRes. Are these variables that allow me know where is the user is watching?
I don't know if I should process the incoming signals from processing module in my Application Module or there are some variables from Processing Module with this information (from LinearClassifier, for example).

Upto now in order to test the system, I use the Signal Generator module and the results are in one of the attach files.

I mean, I obtain the correct SimulusCode form P3SignalProcesing, but, I should work with these?

In other hand, when I said that my application works "almost" fine it is because some times I have a message like this:
Collision in state EventOffset : Oldvalue: 512 New Python Value: 509 New BCI Value: 0

or

debug warning in self.db:
<MultipleTransition': 5, 'state collision in EventOfsset': 43>

And, using BCI2000 v3.05 (latest) I have this message
Execution required more than a sample block duration. (twice).
Execution required more than a sample block duration. (9 times).
The time line you can see in the attach file.

I'm using a 256Hz SamplingRate with a SampleBlockSize = 8

Perhaps, this will not influence in my system, haha!

Please guys, I need help.

Thank you so much, really.

Lucas
Attachments
BCIVeiwer.png
TimeLine.png

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Region based paradigm using BCPy2000

Post by pbrunner » 18 Jan 2016, 13:02

lmbaldezzari,

1) You can see the sequence of stimulation from the P3Speller in the following timeline:
http://www.bci2000.org/wiki/index.php/U ... k#Timeline

2) The P3TemporalFilter reports the selected target after the EpochsToAverage has been reached through the StimulusTypeRes state.
http://www.bci2000.org/wiki/index.php/U ... lusTypeRes

3) You then in your application provide feedback on the selection based on the StimulusTypeRes result.

4) I see form your error message, that your application was consistently exceeding the block time. You can either make the block time larger by increasing the SampleBlockSize or debug the issue that makes your application exceed its allotted processing time.

Regards, Peter

lmbaldezzari
Posts: 8
Joined: 31 May 2015, 09:16

Re: Region based paradigm using BCPy2000

Post by lmbaldezzari » 18 Jan 2016, 19:09

Pbrunner, than you for your reply.

- Respect of StimulusTypeRes: I had understood that this state was delivered by the P3SignalPRocessing in the "Copy Mode" only, this is because when the user must spell some word (i.e. "HELLO") the system assigns a value corresponding to the variable "H" to StimulusType when the "H" is lightup, then the system makes the same with the "E" and so on, so the P3SignalProcessing only deliver a StimulusTypeRes when the StimulusType != 0, this is correct? If you run a "Online Free Mode" mode using the P3Speller and then watch the data file using BCI2000Viewer, there are no StimulysTypeRes, however, the system returns a selected target (you can see this in the attach file), in other hand, if you run a session in "Copy Mode" you can see some StimulusType and StimulusTypeRes deliver by P3SignalProcessing.

Maybe, I'm losing something. Either way, if I can not resolve the problem using an "OnlineFreeMode" in my own application, I will use a "CopyMode", hehe.
4) I see form your error message, that your application was consistently exceeding the block time. You can either make the block time larger by increasing the SampleBlockSize or debug the issue that makes your application exceed its allotted processing time.
- You right, I need to improve the algorithm in order to not lose so much time in some parts of the application.

One more time, thank a lot!

Best regards.

Lucas

P/D: This project is for my thesis degree, but when I finished I will share in github, is a promise!
Attachments
copymode.png
OnlineFreemode.png

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Region based paradigm using BCPy2000

Post by pbrunner » 18 Jan 2016, 19:34

Lucas,

for the online mode to work, you need to decide within your Application module which target the user attended to. For this you keep track of the output of the LinearClassifier output, which is the input for your application module. Basically in BCI2000 the flow is

SpatialFilter -> P3TemporalFilter -> LinearClassifier-> StimulusTask -> P3SpellerTask.

In this flow the input signal gets reduced to a linear regression variable for each stimulus. You can see in the StimulusTask.cpp keeps an account of this and then decides which target has the highest average regression variable. The P3SpellerTask translates this row/column stimulus into a selection.

http://www.bci2000.org/svn/trunk/src/sh ... sifier.cpp
http://www.bci2000.org/svn/trunk/src/co ... erTask.cpp
http://www.bci2000.org/svn/trunk/src/sh ... usTask.cpp

I am looking forward to see your implementation. If it is well documented and general purpose enough, we can integrate it in the BCI2000 distribution.

Regards, Peter

lmbaldezzari
Posts: 8
Joined: 31 May 2015, 09:16

Re: Region based paradigm using BCPy2000

Post by lmbaldezzari » 19 Jan 2016, 15:40

Pbrunner, how are you??

Thank you so much! It's clear now. I need study more deeply in order to implement the same system in my application module, but I think I'm on a right way.

It would be great if I can contribute to the BCI2000 community. If you want, please send me an email so I will contact you and I will send you what I have so far. Any suggestion, critique or advice would be well recived.

I'm gonna to start working in what you said.

Have a nice day.

Lucas

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests