Page 1 of 1

Error when using BCPy2000 + FileFormat=GDF + TargetCode

Posted: 24 May 2013, 22:46
by boulay
It seems that the FileFormat=GDF option does not work when using BCPy2000 and the BCPy2000 application defines a state called "TargetCode".

To reproduce.
Add the following to BCI2000\python\TriangleApplication.py around line 76:

Code: Select all

"TargetCode  2 0 0 0",
Add the following to the end of the PythonSource line in BCI2000\batch\PythonDemo1_Triangle.bat :

Code: Select all

--FileFormat=GDF
Set Config works, but after pressing start, the log shows the following error repeated 4 times:

Code: Select all

2013-05-25T11:39:37 - Expression: State "TargetCode" was accessed during initialization or processing, but not checked for existence during preflight phase.
Interestingly the application continues but no data is written to disk.

I will go through my application and analysis code to change every instance of "TargetCode" to "TargetClass". However, this bug might be indicative of a more general issue so I thought it was worth posting.

-Chad

Re: Error when using BCPy2000 + FileFormat=GDF + TargetCode

Posted: 27 May 2013, 09:15
by mellinger
Hi Chad,

in order to to support GDF's event table, the GDF output code maintains a translation table between BCI2000 states, and GDF event codes. By default, that table contains definitions for the TargetCode state to be translated into GDF events.

To allow for greater flexibility, the translation table allows to specify BCI2000 Expressions rather than plain state names. Unfortunately, in older versions of the BCI2000 framework, accessing states through expressions during preflight would not be properly recognized, resulting in bogus warnings of the type you describe.

That bug has since been fixed (r3383), or BCI2000 3.0.3, but may still be present in the code you are using. You might do a checkout from www.bci2000.org/svn/tags/releases/3.0.5, build the BCPy2000 source module from there, and use that with your BCPy2000 installation.

Regards,
Juergen