Hello everyone!
I would like to know how to write a new state back to BCI2000 using the fieldtrip buffer in matlab. The new state will be used as trigger signal for offline analysis after collecting the data.
I have tried introducing new state name in the FTStatesFromBuffer field, and then use write_event() from Fieldtrip to write to the state. But when I try to set the configuration in BCI2000, it complains "FieldTripBufferFilter::Preflight: State "AlphaPower" is inaccessible." (AlphaPower is the new state I try to introduce).
P.S. I am able to modified existing state, e.g. Feedback, from Fieldtrip, but not able to create new state. I try to follow the instruction at http://www.bci2000.org/wiki/index.php/U ... cripting#1 to create new state using operator script. The operator log reported that a new state is added to the list, but I am not able to see it in the States dialogue of the operator window. Changing the state via the operator script buttons doesn't work either.
Any idea is much appreciated.
Thanks a lot!
Writing new state to BCI2000 via Fieldtrip
-
gschalk
- Posts: 615
- Joined: 28 Jan 2003, 12:37
States
Hi,
You may have used the Operator scripting to try to create a state after the system has been started, which is not possible (if the Operator tells you it did create it, this is a bug). You have to create a state on system startup. Perhaps the best way to do this is to use command line options:
http://www.bci2000.org/wiki/index.php/U ... ne_Options
Let me know if this helped.
Gerv
You may have used the Operator scripting to try to create a state after the system has been started, which is not possible (if the Operator tells you it did create it, this is a bug). You have to create a state on system startup. Perhaps the best way to do this is to use command line options:
http://www.bci2000.org/wiki/index.php/U ... ne_Options
Let me know if this helped.
Gerv
-
teristam
- Posts: 3
- Joined: 12 Jan 2010, 04:27
Thank you so much for the reply!
I have written the following batch file trying to introduce the new state Artifact into the BCI2000:
I then write the following scripts for two operator window buttons:
This is the operator log file after I try to press the buttons to change the Artiface state:
I have written the following batch file trying to introduce the new state Artifact into the BCI2000:
Code: Select all
cd prog
start operat.exe --OnConnect "-INSERT STATE Artifact 1 0; SETCONFIG" --OnSetConfig "-SET STATE Running 1"
start SignalGenerator.exe 127.0.0.1
start FieldTripBuffer.exe 127.0.0.1
start MFCdemo.exe 127.0.0.1
cd ..
Code: Select all
STATE Artifact 1Code: Select all
STATE Artifact 0I was not able to add new state to BCI2000 even though I tried to insert the state using the --OnConnect option.13/1/2010 17:12:39 - BCI2000 started
13/1/2010 17:12:39 - Executing script after all modules connected ...
13/1/2010 17:12:39 - unnamed script: Added state Artifact to list
13/1/2010 17:12:39 - Operator set configuration
13/1/2010 17:12:39 - unnamed script: Set configuration
13/1/2010 17:12:39 - User Application confirmed new parameters ...
13/1/2010 17:12:40 - Signal Processing confirmed new parameters ...
13/1/2010 17:12:40 - Source confirmed new parameters ...
13/1/2010 17:12:40 - Executing OnSetConfig script ...
13/1/2010 17:12:40 - Operator started operation
13/1/2010 17:12:40 - unnamed script: Set state Running to 1 ... OK
13/1/2010 17:12:51 - unnamed script: Set state Artifact to 1 ... Error
13/1/2010 17:12:51 - unnamed script: Set state Artifact to 0 ... Error
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Hi,
you need to specify four numbers in the state definition:
The example in the documentation was wrong. In addition, the operator module would always report successful adding of the state, even if it could not parse the state definition correctly.
I fixed both errors.
Thanks for reporting, and sorry for the inconvenience,
Juergen
you need to specify four numbers in the state definition:
Code: Select all
INSERT STATE Artifact 1 0 0 0I fixed both errors.
Thanks for reporting, and sorry for the inconvenience,
Juergen
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
The behavior of the INSERT STATE scripting command has been changed to comply with the original documentation.
Now, BCI2000 V2 and V3 both allow specifying a state by its name, bit width, and initial value:
Now, BCI2000 V2 and V3 both allow specifying a state by its name, bit width, and initial value:
Code: Select all
INSERT STATE Artifact 1 0Who is online
Users browsing this forum: No registered users and 0 guests
