Hi, I recently joined a BCI team that develops our own application modules. I had a little problem understanding sections of codes in the BciApplication template that comes with the BCPy2000 package. Can someone help me explain them?
1. In the Construct hook,
def Construct(self):
# supply any BCI2000 definition strings for parameters and
# states needed by this module
params = [
]
states = [
"SomeState 1 0 0 0",
]
What are the states mean?
2. In the Process hook,
def Process(self, sig):
# process the new signal packet
pass # or not.
Is this the function that receives input from the signal processing module?
Thank you very much.
SC
BciApplication with BCPy
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Re: BciApplication with BCPy
Hi,
you seem to be unaware of the extensive BCPy2000 documentation, which may be found at
http://bci2000.org/downloads/BCPy2000/BCPy2000.html
Regards,
Juergen
you seem to be unaware of the extensive BCPy2000 documentation, which may be found at
http://bci2000.org/downloads/BCPy2000/BCPy2000.html
Regards,
Juergen
-
scwang
- Posts: 5
- Joined: 21 Jun 2012, 11:37
Re: BciApplication with BCPy
Hi Juergen,mellinger wrote:Hi,
you seem to be unaware of the extensive BCPy2000 documentation, which may be found at
http://bci2000.org/downloads/BCPy2000/BCPy2000.html
Regards,
Juergen
Thank you for the sharing. I am new to the language of Python and the BCI2000 structure, so I was still a little confused after going over the relevant sections in the API page. Right now it would be a great deal of help for me if I can double check my understanding of the program with somebody.
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Re: BciApplication with BCPy
Hi,
information about what BCI2000 states are may be found by googling
Especially, see
http://www.bci2000.org/wiki/index.php/T ... Definition
Googling for
turns up this page:
http://www.bci2000.org/wiki/index.php/P ... ss#Process
The BCPy2000 documentation says this about the Process hook:
http://bci2000.org/downloads/BCPy2000/B ... re-Process
So yes, the Process hook receives its input from the signal processing module, provided you are in the application module. If you are in the signal processing module, the Process hook receives its input from a previous filter, or from the source module.
Regards,
Juergen
information about what BCI2000 states are may be found by googling
Code: Select all
site:bci2000.org statehttp://www.bci2000.org/wiki/index.php/T ... Definition
Googling for
Code: Select all
site:bci2000.org processhttp://www.bci2000.org/wiki/index.php/P ... ss#Process
The BCPy2000 documentation says this about the Process hook:
http://bci2000.org/downloads/BCPy2000/B ... re-Process
So yes, the Process hook receives its input from the signal processing module, provided you are in the application module. If you are in the signal processing module, the Process hook receives its input from a previous filter, or from the source module.
Regards,
Juergen
-
scwang
- Posts: 5
- Joined: 21 Jun 2012, 11:37
Re: BciApplication with BCPy
Hi,
That is very helpful! Thank you. Can I ask one more question off the topic? I saved all experiment results (I guess they are saved as EEG signals?). Can I use these data to feed into the application module and replicate the behavior of the application program off-line?
I think it would help to know if the data saved is in matrix/binary/text/spreadsheet format so that an appropriate program can be used to export the data.
Best regards,
SC
That is very helpful! Thank you. Can I ask one more question off the topic? I saved all experiment results (I guess they are saved as EEG signals?). Can I use these data to feed into the application module and replicate the behavior of the application program off-line?
I think it would help to know if the data saved is in matrix/binary/text/spreadsheet format so that an appropriate program can be used to export the data.
Best regards,
SC
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Re: BciApplication with BCPy
Hi,
for offline processing, see
http://www.bci2000.org/wiki/index.php/U ... Processing
http://www.bci2000.org/wiki/index.php/U ... i2000chain
For more information about BCI2000 data formats, see
http://www.bci2000.org/wiki/index.php/U ... le_Formats
http://www.bci2000.org/wiki/index.php/U ... oad_bcidat
http://www.bci2000.org/wiki/index.php/U ... 2000Export
For a BCI2000 source module that allows to replay data, see
http://www.bci2000.org/wiki/index.php/C ... lePlayback
Note that it will be difficult to use FilePlayback for anything but an exact replay of the recorded data because in an actual experiment the data itself will depend on the behavior of your application in terms of stimulus response, timing, etc. Thus, it is generally more useful to do an offline analysis using the means linked above.
For testing the setup of a P300 speller, you may use the SignalGenerator source module:
http://www.bci2000.org/wiki/index.php/U ... neratorADC
There, set the DCOffset parameter to "100muV", and the OffsetMultiplier parameter to "StimulusType". In your application, define a state "StimulusType". Whenever your application presents a stimulus that should evoke a P300, set "StimulusType" to 1, otherwise leave it at 0. The SignalGenerator will thus produce a rectangular response to attended stimuli, which should lead to a correct selection if the remaining signal processing chain and application module is set up properly.
Regards,
Juergen
for offline processing, see
http://www.bci2000.org/wiki/index.php/U ... Processing
http://www.bci2000.org/wiki/index.php/U ... i2000chain
For more information about BCI2000 data formats, see
http://www.bci2000.org/wiki/index.php/U ... le_Formats
http://www.bci2000.org/wiki/index.php/U ... oad_bcidat
http://www.bci2000.org/wiki/index.php/U ... 2000Export
For a BCI2000 source module that allows to replay data, see
http://www.bci2000.org/wiki/index.php/C ... lePlayback
Note that it will be difficult to use FilePlayback for anything but an exact replay of the recorded data because in an actual experiment the data itself will depend on the behavior of your application in terms of stimulus response, timing, etc. Thus, it is generally more useful to do an offline analysis using the means linked above.
For testing the setup of a P300 speller, you may use the SignalGenerator source module:
http://www.bci2000.org/wiki/index.php/U ... neratorADC
There, set the DCOffset parameter to "100muV", and the OffsetMultiplier parameter to "StimulusType". In your application, define a state "StimulusType". Whenever your application presents a stimulus that should evoke a P300, set "StimulusType" to 1, otherwise leave it at 0. The SignalGenerator will thus produce a rectangular response to attended stimuli, which should lead to a correct selection if the remaining signal processing chain and application module is set up properly.
Regards,
Juergen
Who is online
Users browsing this forum: No registered users and 0 guests
