Jump to content

User Tutorial:BCI2000Remote: Difference between revisions

From BCI2000 Wiki
Nluczak (talk | contribs)
Created page with "==Description== BCI2000Remote is a proxy interface class to the BCI2000 Operator module, and allows to start up, configure, and control BCI2000 from other applications. Intern..."
 
Nluczak (talk | contribs)
No edit summary
Line 3: Line 3:


BCI2000Remote is most useful when writing applications in C++, or in another language for which bindings to the BCI2000RemoteLib library exist, such as Python, or MATLAB.
BCI2000Remote is most useful when writing applications in C++, or in another language for which bindings to the BCI2000RemoteLib library exist, such as Python, or MATLAB.
 
==Note==
BCI2000Remote is a means of interfacing with the BCI2000 Operator module meaning that there are potentially hundreds of ways we leverage this tool to have a meaningful interface with BCI2000. Because of this we will illustrate a few different integrations using different languages. This "How-to" will be separated into three separate sections: Python, C++, and Matlab.
==Tutorial==
==Tutorial==
<ol>
<ol>
Line 9: Line 10:




[[File:Psychopy1.png]]
#[[File:Psychopy1.png]]
</li>
</li>
<li>Copy the folders '''BCIStart''' and '''BCIUpdateState''' from the ''src/contrib/PsychoPy Components'' directory of your BCI2000 repository into the folder {$PsychoPyHome}\Lib\site-packages\psychopy\experiment\components
<li>Copy the folders '''BCIStart''' and '''BCIUpdateState''' from the ''src/contrib/PsychoPy Components'' directory of your BCI2000 repository into the folder {$PsychoPyHome}\Lib\site-packages\psychopy\experiment\components




[[File:Psychopy2.png]]
#[[File:Psychopy2.png]]
</li>
</li>
<li>
<li>
Line 20: Line 21:




[[File:Psychopy3.png]]
#[[File:Psychopy3.png]]
</li>
</li>
<li>
<li>
Line 26: Line 27:




[[File:Psychopy4.png]]
#[[File:Psychopy4.png]]
</li>
</li>
<li>
<li>
Line 35: Line 36:




[[File:Psychopy5.png]]
#[[File:Psychopy5.png]]
</li>
</li>
<li>
<li>
Line 41: Line 42:




[[File:Psychopy6.png]]
#[[File:Psychopy6.png]]
</li>
</li>
<li>
<li>
Line 47: Line 48:




[[File:Psychopy7.png]]
#[[File:Psychopy7.png]]




[[File:Psychopy8.png]]
#[[File:Psychopy8.png]]
</li>
</li>
<li>
<li>
Line 56: Line 57:




[[File:Psychopy9.png]]
#[[File:Psychopy9.png]]




[[File:Psychopy10.png]]
#[[File:Psychopy10.png]]
</li>
</li>
</ol>
</ol>

Revision as of 21:23, 5 October 2021

Description

BCI2000Remote is a proxy interface class to the BCI2000 Operator module, and allows to start up, configure, and control BCI2000 from other applications. Internally, it maintains a telnet connection to the Operator module, and sends Operator Scripting commands to control it. However, no knowledge of these scripting commands is required in order to use the BCI2000Remote class from your own application.

BCI2000Remote is most useful when writing applications in C++, or in another language for which bindings to the BCI2000RemoteLib library exist, such as Python, or MATLAB.

Note

BCI2000Remote is a means of interfacing with the BCI2000 Operator module meaning that there are potentially hundreds of ways we leverage this tool to have a meaningful interface with BCI2000. Because of this we will illustrate a few different integrations using different languages. This "How-to" will be separated into three separate sections: Python, C++, and Matlab.

Tutorial

  1. Download the PsychoPy standalone version from the PsychoPy downloads page.
  2. Copy the folders BCIStart and BCIUpdateState from the src/contrib/PsychoPy Components directory of your BCI2000 repository into the folder {$PsychoPyHome}\Lib\site-packages\psychopy\experiment\components
  3. Open PsychoPy and then open your experiment file (StroopExtended is what we use in the demo)
  4. Open the part of the experiment where you want to start BCI2000 (in this case the instruct tab) and look under the custom section of the components for the BCI Connect and BCI Update State components
  5. Add the BCI2000 Start Component by clicking on it.
  6. Enter the path to the prog folder in the BCI2000 directory where your BCI2000Remote.py file exists
  7. Add the states that you want to record separated by commas (the first value will always be the default value and the second value will always be the maximum value)
  8. Add the BCIUpdateState component to where you want to update state values. You can either choose to simply pass a variable through BCIUpdateState, or you can specify that it execute a specific Python script by choosing the "Use Expression" ticker
  9. Run the experiment

Video

Also see the PsychoPy page for more details on the installation process, APIs, and hooks.


See also