Jump to content

Contributions:BCI2000PythonBindings

From BCI2000 Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Synopsis

BCI2000PythonBindings currently provides a BCI2000Remote class that controls the BCI2000 Operator. It provides the functionality of the BCI2000Remote C++ class in Python.

To use it, import BCI2000Remote.py into Python. This Python module must reside in the same directory as the BCI2000RemoteLib library, which typically resides in the BCI2000/prog directory.

Location

http://www.bci2000.org/svn/trunk/src/contrib/ExternalLinks/BCI2000PythonBindings

Versioning

Author

juergen.mellinger@uni-tuebingen.de

Source Code Revisions

  • Initial development: 4081
  • Tested under: 4082

Functional Description

The BCI2000Remote Python class is an exact Python counterpart to the BCI2000Remote C++ class. For a description, see Programming Reference:BCI2000Remote Class.

Example

bci = BCI2000Remote()
print bci.OperatorPath
bci.WindowTitle = "Python controlled"
bci.SubjectID = "PY1"
bci.Connect()
bci.Execute( "cd ${BCI2000LAUNCHDIR}" )
bci.StartupModules( ( "SignalGenerator", "ARSignalProcessing", "CursorTask" ) )
bci.LoadParametersRemote( "../parms/examples/CursorTask_SignalGenerator.prm" )
bci.SetConfig()
print bci.GetParameter( "SubjectName" )
bci.Start()
bci.Execute( "Wait for Suspended 20" )
bci.Stop()
del bci

See also

Programming Reference:BCI2000Remote Class, Contributions:BCI2000Command, Contributions:BCI2000PresentationLink, Contributions:Applications