<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.bci2000.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aes2376</id>
	<title>BCI2000 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.bci2000.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aes2376"/>
	<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php/Special:Contributions/Aes2376"/>
	<updated>2026-10-25T04:52:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12669</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12669"/>
		<updated>2026-10-19T15:38:22Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: Major task changes documenting reliability jitter changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a configurable visual sensory-reliability manipulation. On selected trials, Gaussian spatial noise perturbs the displayed cursor without changing the task-logic cursor position. High reliability has no visual noise; Medium and Low reliability use configurable noise amplitudes. This is a visual-feedback noise manipulation, not a cursor-gain manipulation.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* High, Medium, and Low visual sensory-reliability conditions with configurable Gaussian cursor noise (disabled by default).&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, displayed and true cursor, joystick (when logging is enabled), target, mapping, reliability, noise, and researcher-control states in the BCI2000 data stream.&lt;br /&gt;
* Experimenter controls for resetting, skipping, pausing, and resuming the task.&lt;br /&gt;
&lt;br /&gt;
The participant is not explicitly informed about mapping changes, sensory-reliability conditions, mapping probabilities, or experimental block structure. Visual noise may nevertheless be perceptible.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
Upon completion of an SVN update or checkout of the relevant source tree, the current FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask_custom&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module uses &amp;lt;code&amp;gt;NOBUNDLE&amp;lt;/code&amp;gt; in its &amp;lt;code&amp;gt;bci2000_add_application_module&amp;lt;/code&amp;gt; declaration. Its Windows executable is typically named:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask_custom.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A separate &amp;lt;code&amp;gt;src/custom/FEP_VisuomotorJoystickTask_pacing_test/&amp;lt;/code&amp;gt; diagnostic module is also included in the custom build. That module is for investigating a rendering/pacing issue and is not the experimental task.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
====New version: 19 October 2026====&lt;br /&gt;
&lt;br /&gt;
This updated version replaces the earlier Normal/High cursor-gain manipulation with configurable High/Medium/Low visual sensory reliability; introduces temporally correlated Gaussian cursor noise and separate true-versus-displayed cursor states; adds researcher controls for skipping trials, blocks, introduction, and sandbox and for pausing/resuming; adds associated BCI2000 event and reliability states; provides configurable cursor and target diameters; and redesigns the diagnostic window to show real-time timings and run averages. The experimental mapping and six block roles remain in place. The current build uses the &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask_custom&amp;lt;/code&amp;gt; target.&lt;br /&gt;
&lt;br /&gt;
No independent numeric version identifier is declared in the inspected module; the date above identifies this documentation update and implementation revision, not an asserted source revision number.&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
An earlier inspected BCI2000 build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to an inspected BCI2000 build containing the module, not to an independently verified revision number of the current FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether visual sensory reliability has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under High, Medium, and Low visual sensory reliability (when enabled).&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of High, Medium, and Low visual sensory reliability when the manipulation is enabled.&lt;br /&gt;
* Differences between true and displayed cursor trajectories under visual noise.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction (unless skipped by the researcher).&lt;br /&gt;
# Joystick sandbox (unless bypassed or skipped).&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant. Skipping the introduction using the researcher window enters the experiment directly and also bypasses the sandbox. Trial and block skipping can change which trials are actually performed.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox. The experimenter may instead select &amp;lt;code&amp;gt;SKIP INTRODUCTION&amp;lt;/code&amp;gt; (with confirmation), which enters the experiment directly and bypasses the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Changes in visual sensory reliability.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* There is no gain manipulation; the sandbox uses direct Normal mapping without visual noise.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox. The researcher can also select &amp;lt;code&amp;gt;SKIP SANDBOX&amp;lt;/code&amp;gt; to enter the experiment.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
After the mapping sequence is generated, sensory-reliability conditions are assigned separately using a dedicated random generator. Rather than an independent shuffle, the assignment algorithm attempts to counterbalance reliability categories across Normal/Inverted mappings and mapping-switch/non-switch trials while preserving the configured counts. Reliability assignment does not alter the mapping order. See [[#Sensory Reliability|Sensory Reliability]].&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset. The code defines no &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; parameter, no &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt; state, and no high-gain movement condition in this version.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction (&amp;lt;code&amp;gt;+1&amp;lt;/code&amp;gt; for Normal or &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; for Inverted).&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement. Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping===&lt;br /&gt;
&lt;br /&gt;
With Normal mapping, the cursor follows the joystick directly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping===&lt;br /&gt;
&lt;br /&gt;
After target onset on an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted. Cursor coordinates are constrained to the normalized range &amp;lt;code&amp;gt;[0, 1]&amp;lt;/code&amp;gt;. While returning from a preceding anchored Inverted trial, that preceding transformation may remain active until the joystick returns to its stored anchor.&lt;br /&gt;
&lt;br /&gt;
The cursor position resulting from mapping and clipping, but before sensory noise, is called the &amp;lt;b&amp;gt;true cursor&amp;lt;/b&amp;gt;. Sensory noise perturbs only the &amp;lt;b&amp;gt;displayed cursor&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Sensory Reliability==&lt;br /&gt;
&lt;br /&gt;
The current implementation manipulates visual sensory reliability using trial-wise Gaussian spatial noise added to the displayed cursor. This replaces the cursor-gain manipulation described in earlier versions. Sensory reliability is disabled by default (&amp;lt;code&amp;gt;EnableSensoryReliability=0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
===Reliability Conditions===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;SensoryReliabilityCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Visual-noise standard deviation&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| High&lt;br /&gt;
| 0 pixels&lt;br /&gt;
| Noise-free visual cursor&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Medium&lt;br /&gt;
| &amp;lt;code&amp;gt;MediumReliabilityNoiseStd&amp;lt;/code&amp;gt; (default 5 pixels)&lt;br /&gt;
| Gaussian cursor-position noise&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Low&lt;br /&gt;
| &amp;lt;code&amp;gt;LowReliabilityNoiseStd&amp;lt;/code&amp;gt; (default 15 pixels)&lt;br /&gt;
| Larger Gaussian cursor-position noise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The noise standard deviations are specified in reference-display pixels, normalized using the task&#039;s nominal 1000 by 750 coordinate system. Noise affects only the cursor during the &amp;lt;code&amp;gt;TargetVisible&amp;lt;/code&amp;gt; phase; the target, center marker, warning marker, cross, and joystick input are not perturbed.&lt;br /&gt;
&lt;br /&gt;
===Enabling Reliability by Block===&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableSensoryReliability=0&amp;lt;/code&amp;gt;, all trials use High reliability and no visual noise is applied, regardless of the requested proportions or block list. Therefore, &amp;lt;code&amp;gt;SensoryReliabilityCondition=0&amp;lt;/code&amp;gt; does not by itself establish that reliability manipulation was enabled.&lt;br /&gt;
&lt;br /&gt;
When enabled, reliability conditions are assigned only within the numbered blocks listed in &amp;lt;code&amp;gt;SensoryReliabilityBlocks&amp;lt;/code&amp;gt;, which defaults to blocks 4, 5, and 6. Blocks not listed always use High reliability. The block list may instead select any subset of the six block roles. A block disabled by setting its trial count to zero has no trials to assign.&lt;br /&gt;
&lt;br /&gt;
===Reliability Assignment and Counterbalancing===&lt;br /&gt;
&lt;br /&gt;
For each enabled block, counts for High, Medium, and Low trials are calculated from the configured proportions by taking their floors and distributing remaining trials according to the largest fractional remainders. The result matches the block&#039;s total trial count.&lt;br /&gt;
&lt;br /&gt;
The application then uses a dedicated &amp;lt;code&amp;gt;std::mt19937&amp;lt;/code&amp;gt; generator to assign those conditions in a randomized trial order. The selection score favors counterbalancing reliability across (1) Normal versus Inverted mapping and (2) mapping-switch versus non-switch trials, subject to the remaining required condition counts. Thus reliability assignment is not a wholly independent shuffle of the mapping sequence. Exact balance in small blocks or uneven sequences is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
Reliability is assigned after the Normal/Inverted mapping sequence has been built and does not change that sequence. Only mapping changes, not reliability changes, generate &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; events. The dedicated noise/assignment seed is distinct from BCI2000&#039;s mapping/target random-number generator.&lt;br /&gt;
&lt;br /&gt;
The configured proportions default to 0.34 High, 0.33 Medium, and 0.33 Low, and their sum must equal 1 within &amp;lt;code&amp;gt;1e-6&amp;lt;/code&amp;gt;. Low-reliability noise SD must be at least Medium-reliability noise SD.&lt;br /&gt;
&lt;br /&gt;
===Temporally Correlated Visual Noise===&lt;br /&gt;
&lt;br /&gt;
X and Y noise are generated from independent Gaussian innovations and evolved over processing updates as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a = exp(-elapsedSeconds / correlationTimeSeconds)&lt;br /&gt;
noiseX = a * previousNoiseX + SD * sqrt(1 - a*a) * N_X(0,1)&lt;br /&gt;
noiseY = a * previousNoiseY + SD * sqrt(1 - a*a) * N_Y(0,1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temporal correlation time is set by &amp;lt;code&amp;gt;SensoryNoiseCorrelationTimeMs&amp;lt;/code&amp;gt; (default 100 ms); a value of zero produces independent innovations on each update. Each trial&#039;s noise generator is initialized from the effective seed and trial/block identity. Noise begins at zero at target onset, so the process builds up rather than beginning with stationary variance. Noise is cleared when the task leaves the target-visible phase and on trial reset or skip.&lt;br /&gt;
&lt;br /&gt;
The displayed cursor is calculated as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
displayedX = clamp(trueX + noiseX / 1000, 0, 1)&lt;br /&gt;
displayedY = clamp(trueY + noiseY / 750, 0, 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true cursor is used for center detection and target-hit detection. Movement onset is detected from joystick movement. Therefore a displayed cursor that appears to touch the target is not necessarily counted as a hit, and a true cursor that reaches the target can register a hit despite noise displacing the displayed cursor away from it.&lt;br /&gt;
&lt;br /&gt;
===Noise Seeds and State Encoding===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SensoryNoiseSeed&amp;lt;/code&amp;gt; defaults to 1. Setting it to 0 selects an automatically generated effective seed, recorded in &amp;lt;code&amp;gt;SensoryNoiseSeedEffective&amp;lt;/code&amp;gt; and reported in the BCI2000 operator log.&lt;br /&gt;
&lt;br /&gt;
Noise values are stored as positive integer states with an offset to represent negative noise; the configured SD is stored in hundredths of a pixel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
noiseX_pixels = (SensoryNoiseX - 1073741824) / 100&lt;br /&gt;
noiseY_pixels = (SensoryNoiseY - 1073741824) / 100&lt;br /&gt;
noiseSD_pixels = SensoryNoiseStd / 100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The recorded &amp;lt;code&amp;gt;TrueCursorX/Y&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorX/Y&amp;lt;/code&amp;gt; coordinates are quantized to the task&#039;s 0–1023 range. The noise states represent the generated visual perturbation before final boundary clipping; consequently, the difference between displayed and true coordinates may not equal the encoded noise exactly near display edges.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Important:&amp;lt;/b&amp;gt; &amp;lt;code&amp;gt;TrueCursorX/Y&amp;lt;/code&amp;gt; is post-mapping, pre-noise position, not a pre-mapping/raw joystick trajectory. The raw joystick trajectory is available from logged joystick input states.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering. It is also engaged when an in-progress Inverted trial is skipped or when an Inverted trial is reset during target-visible movement. Skipping an entire block does not explicitly engage this return path, so direct mapping may be restored immediately in that case.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries. Changes in sensory reliability alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes. When skip controls are used, event states can be stale or missing for a processing block; compare adjacent trials and consult the skip-state guidance below.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across reliability conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by reliability condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target. Advancing after a skipped trial generates a new target; skipping the remaining trials of a block may consume multiple target generations and change the subsequent target sequence.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Center and target-hit testing use the true, pre-noise cursor, not the displayed noisy cursor. During a skip operation, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; and related trial states may remain stale because the normal state-update path is bypassed. In particular, a skip directly to completion may not record &amp;lt;code&amp;gt;TaskPhase=7&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor (diameter configurable with &amp;lt;code&amp;gt;CursorDiameterPixels&amp;lt;/code&amp;gt;).&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target (diameter configurable with &amp;lt;code&amp;gt;TargetDiameterPixels&amp;lt;/code&amp;gt;).&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions in white text on a dark-gray background.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of the current mapping, current reliability condition, mapping switches, &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;, block or trial numbers, block transitions, or mapping probabilities. However, noise under Medium and Low reliability may be perceptible as cursor jitter during target-visible movement.&lt;br /&gt;
&lt;br /&gt;
The target remains black across all mapping and reliability conditions. There is no explicit success-color cue; the target disappears after successful acquisition. The completion text is the literal string &amp;lt;code&amp;gt;&amp;quot; ended &amp;quot;&amp;lt;/code&amp;gt; shown in white.&lt;br /&gt;
&lt;br /&gt;
The target diameter affects both its drawing and the radius used for target-hit testing. The cursor diameter affects its appearance only; it does not change the center tolerance or the target-hit radius.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
===Displayed Information===&lt;br /&gt;
&lt;br /&gt;
During experimental trials, the visible metrics panel displays:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block role number (&amp;lt;code&amp;gt;Block: N / 6&amp;lt;/code&amp;gt;), even if some blocks were disabled.&lt;br /&gt;
* Trial number within the current block and block trial count.&lt;br /&gt;
* Overall trial number and total configured active trials.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current High, Medium, or Low reliability condition.&lt;br /&gt;
* Configured visual-noise standard deviation for that trial, in pixels.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Real-time reaction time, movement time, and total time.&lt;br /&gt;
* Cumulative overall, Normal-mapping, and Reversed-mapping averages of reaction time, movement time, and total time.&lt;br /&gt;
&lt;br /&gt;
The visible panel does &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; show target angle or coordinates, joystick coordinates, cursor coordinates, mapping-switch flag, trials-since-switch counter, movement-started status, &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;, or a separate reset/status message. Run averages are divided by mapping, not by sensory reliability. A separate diagnostic text label exists internally but is hidden and not populated.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control&lt;br /&gt;
! Availability&lt;br /&gt;
! Effect&lt;br /&gt;
! Confirmation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;RESET CURRENT TRIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
| Experiment phases 1–5; shown as &amp;lt;code&amp;gt;RESET UNAVAILABLE&amp;lt;/code&amp;gt; otherwise&lt;br /&gt;
| Restarts the same trial and emits &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SKIP TRIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
| Experiment phases 1–5, not paused&lt;br /&gt;
| Abandons the current trial and advances; emits &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SKIP CURRENT BLOCK&amp;lt;/code&amp;gt;&lt;br /&gt;
| Experiment phases 1–5, not paused&lt;br /&gt;
| Advances past the remaining trials of the block; emits &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SKIP INTRODUCTION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Introduction stage, not paused&lt;br /&gt;
| Enters the experiment directly, bypassing sandbox; emits &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SKIP SANDBOX&amp;lt;/code&amp;gt;&lt;br /&gt;
| Sandbox stage, not paused&lt;br /&gt;
| Enters the experiment; emits &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PAUSE&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;RESUME&amp;lt;/code&amp;gt;&lt;br /&gt;
| All stages/phases except Finished&lt;br /&gt;
| Freezes task-phase progression and resumes with adjusted internal timestamps; uses &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is no separate diagnostic Continue button for the introduction or sandbox. Those stages normally advance using a rising joystick-button press, or may be bypassed using the skip controls.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Clears visual-noise state.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same sensory-reliability condition.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block. Resetting an Inverted trial during target-visible movement also enables the return-to-anchor behavior. A reset request is not processed while paused; requests pending at the time of a pause are deferred until processing resumes.&lt;br /&gt;
&lt;br /&gt;
==Skipping Trials, Blocks, and Tutorial Stages==&lt;br /&gt;
&lt;br /&gt;
===Skip Trial===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SKIP TRIAL&amp;lt;/code&amp;gt; is available during experimental phases before Feedback. It emits a one-processing-block &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt; pulse, clears the current movement/timing values, does not count the abandoned trial in completed-trial performance averages, and advances to the next trial or finishes the run. A new target is generated on each non-final advance. Skipping an Inverted trial engages the return-to-anchor behavior.&lt;br /&gt;
&lt;br /&gt;
===Skip Current Block===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SKIP CURRENT BLOCK&amp;lt;/code&amp;gt; requires confirmation and is available during experimental phases before Feedback. It emits &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;, advances through all remaining trials in the current block, and starts the next enabled block or finishes the run. It does not register those abandoned trials as completed performance measurements. The operation calls the normal advancement routine repeatedly, consuming target-generation random-number draws. Unlike single-trial skip, it does not explicitly engage return-to-anchor for the interrupted Inverted trial.&lt;br /&gt;
&lt;br /&gt;
===Skip Introduction and Sandbox===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SKIP INTRODUCTION&amp;lt;/code&amp;gt;, after confirmation, emits &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt; and enters the experimental phase directly, also bypassing the sandbox. &amp;lt;code&amp;gt;SKIP SANDBOX&amp;lt;/code&amp;gt; emits &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt; and enters the experimental phase from the sandbox. Both are available only in their corresponding stage when not paused.&lt;br /&gt;
&lt;br /&gt;
===Pause and Resume===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PAUSE&amp;lt;/code&amp;gt; is available during introduction, sandbox, and experimental phases, including Feedback, but not Finished. While paused, &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; is held at 1, phase progression and cursor rendering updates stop, and joystick states continue to be sampled. On resumption, internal phase, target-onset, movement-onset, and noise-update timestamps are shifted by the pause duration so that measured task intervals exclude paused time. Skip controls are disabled while paused; pending requests are not executed until processing resumes.&lt;br /&gt;
&lt;br /&gt;
===State-Logging Caveats During Skips===&lt;br /&gt;
&lt;br /&gt;
The skip-handling branches return early from &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; before the usual end-of-block state publication. Consequently, &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;, and other trial states may show the preceding values on the skip processing block. They normally update on a later ordinary processing block. &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; can be stale or fail to pulse on the skip block. If a skip ends the run, the usual &amp;lt;code&amp;gt;TaskPhase=7&amp;lt;/code&amp;gt; update may never be recorded. Do not rely on a single isolated processing block to reconstruct skip transitions; inspect adjacent samples, skip event states, and trial/block identifiers. These behaviors are analysis considerations of the current implementation, not intended additional task conditions.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase. When a target is reached without a detected movement onset, reaction and movement times are recorded as 0 and excluded from the corresponding run averages, while total time is still recorded. Paused durations are excluded through adjustment of internal timestamps when resuming.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters. A count of zero disables that block without renumbering the remaining block roles.&lt;br /&gt;
&lt;br /&gt;
===Task Timing and Display===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 3.0&lt;br /&gt;
| 0.0-60.0&lt;br /&gt;
| Required uninterrupted center-hold duration in seconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 0.5&lt;br /&gt;
| 0.0-60.0&lt;br /&gt;
| Yellow warning interval in seconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 0.5&lt;br /&gt;
| 0.0-60.0&lt;br /&gt;
| Delay between warning and target onset in seconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 0.5&lt;br /&gt;
| 0.0-60.0&lt;br /&gt;
| Feedback interval following target acquisition, in seconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorDiameterPixels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 16.0&lt;br /&gt;
| 1.0-1000.0&lt;br /&gt;
| Cursor drawing diameter in nominal reference pixels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetDiameterPixels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 36.0&lt;br /&gt;
| 1.0-1000.0&lt;br /&gt;
| Target drawing and hit-test diameter in nominal reference pixels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 0&lt;br /&gt;
| 0 through number of detected displays&lt;br /&gt;
| Physical monitor for participant stimuli; 0 uses default BCI2000 placement&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On Windows, the application enumerates available monitors for &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;CursorDiameterPixels&amp;lt;/code&amp;gt; affects cursor appearance only; &amp;lt;code&amp;gt;TargetDiameterPixels&amp;lt;/code&amp;gt; also changes the hit-test radius.&lt;br /&gt;
&lt;br /&gt;
===Sensory Reliability Configuration===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;EnableSensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 0&lt;br /&gt;
| 0-1&lt;br /&gt;
| Enable trial-wise visual-reliability noise; 0 disables it&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MediumReliabilityNoiseStd&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 5.0&lt;br /&gt;
| 0.0-1000.0&lt;br /&gt;
| Gaussian noise SD in pixels for Medium reliability&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LowReliabilityNoiseStd&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 15.0&lt;br /&gt;
| 0.0-1000.0&lt;br /&gt;
| Gaussian noise SD in pixels for Low reliability&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;HighReliabilityProportion&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 0.34&lt;br /&gt;
| 0.0-1.0&lt;br /&gt;
| Target High-reliability trial proportion in enabled blocks&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MediumReliabilityProportion&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 0.33&lt;br /&gt;
| 0.0-1.0&lt;br /&gt;
| Target Medium-reliability trial proportion in enabled blocks&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LowReliabilityProportion&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 0.33&lt;br /&gt;
| 0.0-1.0&lt;br /&gt;
| Target Low-reliability trial proportion in enabled blocks&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseCorrelationTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Float&lt;br /&gt;
| 100.0&lt;br /&gt;
| 0.0-60000.0&lt;br /&gt;
| Temporal correlation time constant of noise, in milliseconds; zero gives independent innovations&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseSeed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 1&lt;br /&gt;
| 0-2147483647&lt;br /&gt;
| Dedicated condition-assignment and noise seed; zero automatically selects a seed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryReliabilityBlocks&amp;lt;/code&amp;gt;&lt;br /&gt;
| List&lt;br /&gt;
| 4 5 6 (BCI2000 definition: &amp;lt;code&amp;gt;3 4 5 6&amp;lt;/code&amp;gt;, where 3 is the list length)&lt;br /&gt;
| Entries 1-6; no duplicates&lt;br /&gt;
| Block role numbers in which reliability conditions may be assigned; an empty list means all trials are High reliability&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Parameter Validation===&lt;br /&gt;
&lt;br /&gt;
Preflight requires at least one configured experimental trial, finite and nonnegative reliability values, noise SD for Low reliability not less than that for Medium, reliability proportions summing to 1 within &amp;lt;code&amp;gt;1e-6&amp;lt;/code&amp;gt;, valid unduplicated reliability-block numbers, positive cursor and target diameters, nonnegative task durations, and a valid selected display. The published parameter definitions also specify the listed bounds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is no longer a parameter in this version. There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are declared by the FEP task. Widths and initial values refer to their published definitions; runtime values may change immediately on &amp;lt;code&amp;gt;StartRun()&amp;lt;/code&amp;gt; or during &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Displayed horizontal cursor position, after mapping, sensory noise, and clipping (0-1023)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Displayed vertical cursor position, after mapping, sensory noise, and clipping (0-1023)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase (0-7)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted mapping&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate (0-1023)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate (0-1023)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current original experimental block role (1-6; 0 before experiment)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall 1-based experimental trial number (0 before experiment)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Level flag indicating detected movement onset during the trial&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block target-acquisition pulse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block manual-reset pulse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block trial-skip pulse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block current-block-skip pulse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block introduction-skip pulse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block sandbox-skip pulse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Level flag: 1 while paused; 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| One-processing-block mapping-change event during normal progression; see skip caveats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Consecutive non-switch trial transitions since the most recent mapping change&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior-frequency context (0-3)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox; 0 during experiment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in rounded milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in rounded milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-onset to acquisition time in rounded milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryReliabilityCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 High, 1 Medium, 2 Low reliability&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrueCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Post-mapping, pre-noise horizontal task-logic cursor position (0-1023)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrueCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Post-mapping, pre-noise vertical task-logic cursor position (0-1023)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 31 bit&lt;br /&gt;
| 1073741824&lt;br /&gt;
| X noise encoded as 1073741824 + round(100 * noise pixels)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 31 bit&lt;br /&gt;
| 1073741824&lt;br /&gt;
| Y noise encoded as 1073741824 + round(100 * noise pixels)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseStd&amp;lt;/code&amp;gt;&lt;br /&gt;
| 18 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Configured noise SD encoded as round(100 * pixels)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseSeedEffective&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 1&lt;br /&gt;
| Effective noise and reliability-assignment seed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position supplied through BCI2000 input logging&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position supplied through BCI2000 input logging&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses BCI2000&#039;s standard &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment. Joystick logging must be configured separately using &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The task does not define &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;, an exact state named &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;. Instead, displayed coordinates use &amp;lt;code&amp;gt;CursorX/Y&amp;lt;/code&amp;gt;, pre-noise coordinates use &amp;lt;code&amp;gt;TrueCursorX/Y&amp;lt;/code&amp;gt;, and visual reliability is recorded through &amp;lt;code&amp;gt;SensoryReliabilityCondition&amp;lt;/code&amp;gt; and the sensory-noise states.&lt;br /&gt;
&lt;br /&gt;
===State Lifecycle and Encoding Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetX/Y&amp;lt;/code&amp;gt; have published initial values of 512 but are explicitly set to 0 during introduction/sandbox. &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; is 1-based once experimental trials begin. Pulse states normally clear on the following processing block, whereas &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; is held at 1 throughout a pause and &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; remains high from movement detection until trial advancement. Noise states use fixed-point encoding described in [[#Noise Seeds and State Encoding|Noise Seeds and State Encoding]]. State publication immediately after skip operations has known limitations described in [[#State-Logging Caveats During Skips|State-Logging Caveats During Skips]].&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final displayed cursor position including mapping inversion, return-to-anchor transformation, any applied Gaussian visual noise, and display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrueCursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrueCursorY&amp;lt;/code&amp;gt; record the separate &amp;lt;b&amp;gt;post-mapping, pre-noise&amp;lt;/b&amp;gt; cursor trajectory. This is the trajectory used for center detection and target-hit detection. It does not represent untransformed joystick input.&lt;br /&gt;
&lt;br /&gt;
The participant-visible drawing is positioned using the displayed cursor. Both true and displayed coordinates are recorded as 10-bit states over the range 0-1023. Encoded noise samples are recorded separately. The diagnostic window does not currently show either cursor coordinate pair.&lt;br /&gt;
&lt;br /&gt;
The application does not record an independent pre-mapping cursor state. When enabled, &amp;lt;code&amp;gt;JoystickXpos/Ypos&amp;lt;/code&amp;gt; provide the underlying joystick samples needed to reconstruct a raw joystick-equivalent trajectory offline.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file, subject to the configured BCI2000 recording and joystick-logging settings.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Displayed and true cursor trajectories (&amp;lt;code&amp;gt;CursorX/Y&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrueCursorX/Y&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Joystick trajectory when external joystick logging is enabled.&lt;br /&gt;
* Task phase, Normal/Inverted mapping, prior context, and mapping-switch history.&lt;br /&gt;
* Sensory-reliability condition, actual generated noise, configured noise SD, and effective seed.&lt;br /&gt;
* Target angle and coordinates, experimental block, and trial number.&lt;br /&gt;
* Movement onset, target acquisition, and reaction/movement/total timing.&lt;br /&gt;
* Trial reset, trial skip, block skip, introduction skip, sandbox skip, and pause status.&lt;br /&gt;
* Introduction/sandbox status and experiment completion as represented by task states.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operator Logging===&lt;br /&gt;
&lt;br /&gt;
The application writes &amp;lt;code&amp;gt;bciout&amp;lt;/code&amp;gt; messages for task startup and shutdown, the effective sensory-noise seed, per-block High/Medium/Low reliability distributions split by Normal/Inverted mapping and switch status, and trial-completion results including trial, block, mapping, reliability, reaction time, and movement time. These are diagnostic/operator messages rather than a separate structured task-results file.&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific CSV file, JSON file, text results file, or database. There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
The table below gives common event and measurement identifications. When reset, skip, or pause controls are used, inspect adjacent processing blocks and the recorded configuration instead of relying solely on one state sample.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High reliability&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryReliabilityCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Medium reliability&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryReliabilityCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Low reliability&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryReliabilityCondition == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reliability globally disabled&lt;br /&gt;
| Verify &amp;lt;code&amp;gt;EnableSensoryReliability == 0&amp;lt;/code&amp;gt; in recorded parameters; all trials then use condition 0&lt;br /&gt;
|-&lt;br /&gt;
| Configured visual-noise SD&lt;br /&gt;
| &amp;lt;code&amp;gt;SensoryNoiseStd / 100&amp;lt;/code&amp;gt; pixels&lt;br /&gt;
|-&lt;br /&gt;
| Actual X visual noise&lt;br /&gt;
| &amp;lt;code&amp;gt;(SensoryNoiseX - 1073741824) / 100&amp;lt;/code&amp;gt; pixels&lt;br /&gt;
|-&lt;br /&gt;
| Actual Y visual noise&lt;br /&gt;
| &amp;lt;code&amp;gt;(SensoryNoiseY - 1073741824) / 100&amp;lt;/code&amp;gt; pixels&lt;br /&gt;
|-&lt;br /&gt;
| Pre-noise task-logic cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;TrueCursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrueCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Displayed cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt; (subject to skip-operation caveats)&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; (subject to skip-operation caveats)&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trial skipped&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Current block skipped&lt;br /&gt;
| &amp;lt;code&amp;gt;ConditionSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction skipped&lt;br /&gt;
| &amp;lt;code&amp;gt;IntroductionSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox skipped&lt;br /&gt;
| &amp;lt;code&amp;gt;SandboxSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Task paused&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPaused == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt; in ordinary progression; may be absent for skip-to-finish&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following are designed to be one-processing-block event flags: &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; instead remains high from movement onset through the rest of the trial and Feedback. &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; is a level state held at 1 throughout a pause.&lt;br /&gt;
&lt;br /&gt;
===Analysis Considerations===&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;CursorX/Y&amp;lt;/code&amp;gt; for what the participant saw and &amp;lt;code&amp;gt;TrueCursorX/Y&amp;lt;/code&amp;gt; for the cursor that determined hits and centering. Visual noise and display clipping can make the two disagree.&lt;br /&gt;
* Divide cursor-state coordinates by 1023 to recover normalized coordinates. Use the provided noise-state offset and scale to recover noise in pixels.&lt;br /&gt;
* Use the recorded parameter &amp;lt;code&amp;gt;EnableSensoryReliability&amp;lt;/code&amp;gt; to distinguish a disabled manipulation from genuine High-reliability trials.&lt;br /&gt;
* Reconstruct prior mapping by inspecting previous trials; &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is a block context rather than a previous-trial label or inferred belief.&lt;br /&gt;
* Check skip pulses and neighboring trial/block values when deriving event onsets. Mapping-switch pulses, trial identifiers, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; may be stale or missing on early-return skip processing blocks.&lt;br /&gt;
* Paused intervals should be identified from &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt;, and internal timing measurements exclude pause duration on resume.&lt;br /&gt;
* If target acquisition occurs without a detected movement onset, reaction and movement timing states are zero but total time is recorded; such zero values should not automatically be interpreted as physiologically instantaneous responses.&lt;br /&gt;
* Raw joystick reconstruction requires external input logging; the application itself does not activate &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliabilityCondition&amp;lt;/code&amp;gt; and configurable High/Medium/Low visual sensory reliability.&lt;br /&gt;
* Configurable Gaussian cursor noise and correlation time.&lt;br /&gt;
* Separate &amp;lt;code&amp;gt;TrueCursorX/Y&amp;lt;/code&amp;gt; and displayed &amp;lt;code&amp;gt;CursorX/Y&amp;lt;/code&amp;gt; logging.&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryNoiseX/Y&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SensoryNoiseStd&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;SensoryNoiseSeedEffective&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Researcher controls for skipping trial, block, introduction, and sandbox, and pausing/resuming.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; states.&lt;br /&gt;
* Configurable &amp;lt;code&amp;gt;CursorDiameterPixels&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetDiameterPixels&amp;lt;/code&amp;gt; parameters.&lt;br /&gt;
* Diagnostic real-time timing values and run averages.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* Reliability manipulation is disabled by default; &amp;lt;code&amp;gt;SensoryReliabilityCondition=0&amp;lt;/code&amp;gt; by itself does not show that reliability was enabled.&lt;br /&gt;
* Reliability is assigned with a counterbalancing heuristic across mapping and switch status, not by a wholly independent shuffle.&lt;br /&gt;
* Gaussian noise affects the displayed cursor only during target-visible movement; it does not change the cursor position used for center and target-hit detection.&lt;br /&gt;
* The display may visually disagree with the target-hit decision because logic uses the true pre-noise cursor.&lt;br /&gt;
* The correlated noise process begins at zero at target onset rather than stationary variance.&lt;br /&gt;
* The true cursor is separately recorded, but no independent pre-mapping/untransformed cursor trajectory is recorded.&lt;br /&gt;
* The diagnostic window does not show target, joystick, cursor, switch, trials-since-switch, or free-form status fields; run averages are divided by Normal/Reversed mapping, not by reliability.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetDiameterPixels&amp;lt;/code&amp;gt; changes target-hit radius; &amp;lt;code&amp;gt;CursorDiameterPixels&amp;lt;/code&amp;gt; changes only cursor appearance.&lt;br /&gt;
* Skip operations can result in stale or missing per-block values for &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;, and trial/block identifiers. Skip-to-finish may not publish &amp;lt;code&amp;gt;TaskPhase=7&amp;lt;/code&amp;gt;.&lt;br /&gt;
* A block skip during Inverted target-visible movement does not explicitly preserve the anchored return mapping.&lt;br /&gt;
* Pausing is allowed during introduction, sandbox, and feedback, and the timing system compensates for pause duration on resume.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
* No application-specific CSV, JSON, text results file, or database is generated.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;br /&gt;
&lt;br /&gt;
* [[Category:User Application]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12668</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12668"/>
		<updated>2026-10-19T15:36:59Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: Documenting new Jitter changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each experimental trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition (labeled &#039;&#039;&#039;Normal&#039;&#039;&#039; to the participant), joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition (labeled &#039;&#039;&#039;Reversed&#039;&#039;&#039; to the participant), joystick-to-cursor movement is inverted after the target appears. The numerical &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; encodings remain 0 and 1, respectively.&lt;br /&gt;
&lt;br /&gt;
The task also includes an optional participant introduction and practice sequence. Before the experiment begins, participants may receive task instructions, explore both normal and reversed cursor mappings, and complete automatic and controlled practice trials. Tutorial and practice periods are recorded in the BCI2000 data stream but remain separate from experimental trial numbering and experimental performance summaries.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&lt;br /&gt;
The following video demonstrates the Visuomotor Joystick Task running in BCI2000, including the participant display and joystick-controlled task behavior: &amp;lt;youtube alignment=&amp;quot;center&amp;quot;&amp;gt;https://www.youtube.com/watch?v=LSZW3nxg3Vg&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This video displays version 1 of the task, and as such does not include the pre-experiment participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
In the inspected development checkout, the USB HID Visuomotor Joystick Task is located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/usb_hid_joystick_task/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is &amp;lt;code&amp;gt;usb_hid_joystick_task_custom&amp;lt;/code&amp;gt; (configured with &amp;lt;code&amp;gt;NOBUNDLE&amp;lt;/code&amp;gt;), and the target explicitly requires C++17. This checkout is tracked in Git; the former &amp;lt;code&amp;gt;src/private/Application/VisuomotorJoystickTask&amp;lt;/code&amp;gt; SVN location does not describe the inspected source tree.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The paths and target above describe the checkout inspected for this documentation update; another deployed BCI2000 tree may arrange custom modules differently.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* An optional participant tutorial and practice sequence.&lt;br /&gt;
* Automatic and controlled practice trials.&lt;br /&gt;
* Free-movement demonstrations of normal and reversed cursor control.&lt;br /&gt;
* Joystick-button and experimenter-controlled tutorial progression.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, tutorial status, practice trials, and trial events.&lt;br /&gt;
* A separate diagnostic window with visible performance metrics, tutorial controls, manual trial reset, researcher skip controls, and pause/resume.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
* Configurable cursor and target diameters, with target size affecting acquisition tolerance.&lt;br /&gt;
* Dedicated one-processing-block states for researcher skip events and a persistent pause state.&lt;br /&gt;
* Participant-facing Normal/Reversed terminology and condition cues, without changing automatic/controlled state encodings.&lt;br /&gt;
* Separation of tutorial/practice data from experimental trial numbering and run-summary metrics.&lt;br /&gt;
* Behavioral recording through synchronized BCI2000 states; this version does not create a separate results CSV.&lt;br /&gt;
&lt;br /&gt;
The inspected development checkout contains the task under &amp;lt;code&amp;gt;src/custom/usb_hid_joystick_task&amp;lt;/code&amp;gt; and has Git history through 2026-10-12 (commit &amp;lt;code&amp;gt;83404dd&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under (earlier revision): BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Earlier documented source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;New version, 10/12/26:&#039;&#039;&#039; Latest inspected task commit &amp;lt;code&amp;gt;83404dd&amp;lt;/code&amp;gt;. Added researcher pause/resume and skip controls with corresponding states, configurable cursor/target diameters, participant-facing Normal/Reversed labels and condition cues, and updated diagnostic metrics display; removed secondary CSV output and &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt;. Source moved to the inspected custom-module location and CMake target described above.&lt;br /&gt;
* Current inspected source revision: &#039;&#039;&#039;10/12/26&#039;&#039;&#039; (Git commit &amp;lt;code&amp;gt;83404dd&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
The earlier framework and compiler information above does not establish a successful build or runtime test of the 10/12/26 source revision; the present update is based on source comparison.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default experimental center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures. The current participant-facing descriptions call these mappings Normal and Reversed, respectively; the legacy condition identifiers are retained in code and parameters.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates experimental targets over a continuous range of angles rather than restricting targets to eight positions. It also provides an optional tutorial and practice sequence and records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
When the tutorial is enabled, its content depends on &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Experiment mode&lt;br /&gt;
! Tutorial content&lt;br /&gt;
|-&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| General introduction, normal free movement, automatic instructions, automatic practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| General introduction, normal free movement, controlled instructions, controlled free movement, controlled practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Ordered&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|-&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When both conditions are present, the tutorial always presents automatic training before controlled training. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; affects the experimental block order but does not change the tutorial order. The participant sees Normal/Reversed wording for these conditions, while the experiment parameters and state names continue to use Automatic/Controlled identifiers.&lt;br /&gt;
&lt;br /&gt;
===Tutorial and Practice Sequence===&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, the tutorial begins at the start of each run before the first experimental block.&lt;br /&gt;
&lt;br /&gt;
The tutorial consists of the following stages:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! TutorialPhase&lt;br /&gt;
! Stage&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| None&lt;br /&gt;
| Tutorial inactive; normal experiment operation&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Introduction&lt;br /&gt;
| General explanation of the task and upcoming conditions&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Normal free movement&lt;br /&gt;
| Participant explores normal direct joystick-to-cursor movement&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Normal instructions&lt;br /&gt;
| Explanation of the automatic (Normal) condition and green targets&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Normal practice&lt;br /&gt;
| Automatic practice trials using the normal mapping&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Reversed instructions&lt;br /&gt;
| Explanation of the controlled (Reversed) condition and red targets&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Reversed free movement&lt;br /&gt;
| Participant explores continuous reversed joystick-to-cursor control&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Reversed practice&lt;br /&gt;
| Controlled practice trials using the inverted mapping&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Complete&lt;br /&gt;
| Practice-complete summary before the experiment begins&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=0&amp;lt;/code&amp;gt;, the tutorial is skipped and the task begins with the original experimental block-announcement sequence.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Continuation===&lt;br /&gt;
&lt;br /&gt;
Tutorial screens that require participant acknowledgement may be advanced using either:&lt;br /&gt;
&lt;br /&gt;
* Joystick button 1, or&lt;br /&gt;
* The experimenter&#039;s &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
Joystick continuation uses rising-edge detection. Pressing the button advances one eligible tutorial screen, while holding the button does not repeatedly advance the tutorial. The button must be released and pressed again to produce another continuation event.&lt;br /&gt;
&lt;br /&gt;
Button presses are ignored during active practice trials and during tutorial transitions that require the participant to return the joystick or cursor to center.&lt;br /&gt;
&lt;br /&gt;
During the experimental portion of the run, joystick button presses do not control trial progression. The researcher &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; control displays &#039;&#039;&#039;CONTINUE UNAVAILABLE&#039;&#039;&#039; when continuation is not permitted. The researcher can also use context-specific skip controls to bypass eligible tutorial stages; these actions are documented under [[#Researcher Skip Controls|Researcher Skip Controls]]. The task can be paused during tutorial stages.&lt;br /&gt;
&lt;br /&gt;
===Normal Free Movement===&lt;br /&gt;
&lt;br /&gt;
During the normal free-movement stage, the participant may freely move the cursor using the direct absolute joystick mapping.&lt;br /&gt;
&lt;br /&gt;
There is no timer or trial progression during this stage. It continues until the participant presses the joystick button or the experimenter selects &#039;&#039;&#039;CONTINUE&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Automatic Practice===&lt;br /&gt;
&lt;br /&gt;
Automatic practice uses the same direct mapping and the same basic trial phases as experimental automatic trials:&lt;br /&gt;
&lt;br /&gt;
# Waiting for center&lt;br /&gt;
# Holding center&lt;br /&gt;
# Warning&lt;br /&gt;
# Pre-target delay&lt;br /&gt;
# Target visible&lt;br /&gt;
# Feedback&lt;br /&gt;
&lt;br /&gt;
Practice trials differ from experimental trials in several ways:&lt;br /&gt;
&lt;br /&gt;
* Center hold is determined by &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Practice targets follow a deterministic sequence.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; remain 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; identifies the active practice trial.&lt;br /&gt;
* Practice activity is recorded in BCI2000 states; this application writes no separate trial-level CSV file.&lt;br /&gt;
* Practice results are excluded from experimental completion counts and timing summaries.&lt;br /&gt;
* Practice reset attempts do not increment experimental reset metrics.&lt;br /&gt;
&lt;br /&gt;
After the final automatic practice trial, the participant must return the cursor to the center before the tutorial advances.&lt;br /&gt;
&lt;br /&gt;
===Controlled Free Movement===&lt;br /&gt;
&lt;br /&gt;
The controlled free-movement stage allows the participant to explore reversed cursor control without a target.&lt;br /&gt;
&lt;br /&gt;
The participant is first asked to return the cursor to center. Once centered, the application records the current joystick and cursor positions as anchors and enables the same relative inverted mapping used during target-directed controlled movement.&lt;br /&gt;
&lt;br /&gt;
When the participant requests continuation, the task requires the joystick to return to the anchored position before advancing. This prevents an abrupt cursor jump when the mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Controlled Practice===&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses the same basic controlled-trial behavior as the experiment:&lt;br /&gt;
&lt;br /&gt;
* Direct absolute mapping is used during centering.&lt;br /&gt;
* Joystick and cursor anchors are recorded when the target appears.&lt;br /&gt;
* Target-directed cursor movement uses the relative inverted mapping.&lt;br /&gt;
* The participant returns the joystick toward its anchor after target acquisition.&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; and deterministic practice targets and remains separate from experimental numbering and performance summaries. Its states are recorded in the BCI2000 data stream; no secondary CSV is written.&lt;br /&gt;
&lt;br /&gt;
After the final controlled practice trial, the participant must complete the return-to-center and return-to-anchor transition before the completion screen appears.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Completion===&lt;br /&gt;
&lt;br /&gt;
The completion screen summarizes the condition mappings:&lt;br /&gt;
&lt;br /&gt;
* Normal (automatic): cursor movement follows joystick movement.&lt;br /&gt;
* Reversed (controlled): cursor movement is opposite joystick movement.&lt;br /&gt;
* Green targets identify automatic trials.&lt;br /&gt;
* Red targets identify controlled trials.&lt;br /&gt;
&lt;br /&gt;
After continuation, the tutorial ends, &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; returns to 0, the originally generated first experimental target is restored, and the experiment begins with the normal 1.5-second block announcement.&lt;br /&gt;
&lt;br /&gt;
===Experimental Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each experimental block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Normal&#039;&#039;&#039;, &#039;&#039;&#039;Reversed&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;. These visible labels correspond to the existing automatic, controlled, and mixed block types; their numerical encodings are unchanged.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new experimental trial. Manually resetting a trial does not generate a new target. Skipping an experimental trial instead advances to the next trial and generates a new target (unless the experiment has finished). A skip-block action advances past the remaining trials in the block.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition (Normal)===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition (Reversed)===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is used during the tutorial as a participant continuation button. A rising button press may advance eligible tutorial screens. It does not advance active practice trials and has no effect on experimental trial progression.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Experimental Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows experimental targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Practice Target Generation===&lt;br /&gt;
&lt;br /&gt;
Practice trials use a deterministic six-angle sequence rather than the experimental random target generator:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sequence value&lt;br /&gt;
! Target angle&lt;br /&gt;
|-&lt;br /&gt;
| 150&lt;br /&gt;
| 15 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 450&lt;br /&gt;
| 45 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 750&lt;br /&gt;
| 75 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1050&lt;br /&gt;
| 105 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1350&lt;br /&gt;
| 135 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1650&lt;br /&gt;
| 165 degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Automatic practice begins with the 15-degree target and follows the sequence in order.&lt;br /&gt;
&lt;br /&gt;
Controlled practice begins with an offset of two positions, producing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
75°, 105°, 135°, 165°, 15°, 45°&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If more than six practice trials are configured, the sequence repeats.&lt;br /&gt;
&lt;br /&gt;
These targets are positioned in the lower half of the participant display to reduce overlap with tutorial text.&lt;br /&gt;
&lt;br /&gt;
The random target generated for the first experimental trial is saved before the tutorial begins and restored after practice finishes.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current trial phase is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement / no active practice trial&lt;br /&gt;
| During the experiment, the upcoming block type is being displayed. During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is also 0.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During active automatic or controlled practice trials, values 1 through 6 retain the same meanings as they do during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Because non-trial tutorial screens use &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;, analysts should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish tutorial screens from experimental block announcements.&lt;br /&gt;
&lt;br /&gt;
An experimental target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A practice target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 1&lt;br /&gt;
and PracticeTrial &amp;gt; 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; reflects the tutorial condition rather than the first experimental condition. It begins at 0 during the general introduction and normal free-movement stages, including in Controlled Only mode, and changes to 1 once the controlled portion of the tutorial begins.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; is forced to 0 and should not be interpreted as an experimental ordered-automatic block. The participant sees Normal for &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt; and Reversed for &amp;lt;code&amp;gt;TaskCondition=1&amp;lt;/code&amp;gt;; these labels do not change the state values.&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background (&amp;lt;code&amp;gt;0xEBEBEB&amp;lt;/code&amp;gt;).&lt;br /&gt;
* A black cursor whose diameter is configured by &amp;lt;code&amp;gt;CursorDiameterPixels&amp;lt;/code&amp;gt; (default 16 pixels in the reference display).&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic (Normal) trials.&lt;br /&gt;
* A red target during controlled (Reversed) trials.&lt;br /&gt;
* A target diameter controlled by &amp;lt;code&amp;gt;TargetDiameterPixels&amp;lt;/code&amp;gt; (default 36 pixels). This value also affects the elliptical target-hit tolerance, not just appearance.&lt;br /&gt;
* A visible &#039;&#039;&#039;NORMAL&#039;&#039;&#039; or &#039;&#039;&#039;REVERSED&#039;&#039;&#039; condition cue near the top of the participant display during relevant tutorial stages and block announcements.&lt;br /&gt;
* A progress bar near the top of the display during the experiment.&lt;br /&gt;
* Tutorial and practice instructions when the introduction is enabled, including white text in a dark gray message box.&lt;br /&gt;
* Block announcements using the terms Normal, Reversed, or Mixed.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all experimental trials are complete.&lt;br /&gt;
&lt;br /&gt;
The experimental progress bar is hidden throughout the tutorial and practice sequence. Practice trials do not contribute to experimental progress. When a researcher skips the remainder of an experimental block, the bar can advance to reflect the skipped trial positions even though those trials are not counted as successfully completed.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The Normal/Reversed cue is intentional in this USB HID task. The underlying state encoding remains &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt; for automatic/Normal and &amp;lt;code&amp;gt;TaskCondition=1&amp;lt;/code&amp;gt; for controlled/Reversed.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. In the currently inspected version, the visible panel is the &#039;&#039;&#039;performance metrics panel&#039;&#039;&#039;. During the tutorial it presents the introduction/practice context, mapping condition and applicable practice-trial information; live timing is shown as placeholders where appropriate, and run averages are not yet available. During experimental trials it presents:&lt;br /&gt;
&lt;br /&gt;
* Normal or Reversed condition and trial numbering within the block and overall experiment.&lt;br /&gt;
* Real-time reaction time, movement time, and total time.&lt;br /&gt;
* Overall and condition-specific (automatic and controlled) mean timing measurements.&lt;br /&gt;
&lt;br /&gt;
The application still assembles a more detailed diagnostic text label containing tutorial phase, task phase, target position, joystick and cursor coordinates, movement status, block type, completion/reset counts, and other status information. However, that text widget is explicitly hidden in the inspected build (&amp;lt;code&amp;gt;mpDiagnosticText-&amp;amp;gt;hide()&amp;lt;/code&amp;gt;). These detailed values are &#039;&#039;&#039;not visible&#039;&#039;&#039; in the current diagnostic window and should not be mistaken for on-screen readouts. Relevant values can still be obtained from the recorded states.&lt;br /&gt;
&lt;br /&gt;
===Researcher Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window contains a blue &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button on eligible tutorial screens. When continuation is unavailable, it displays &#039;&#039;&#039;CONTINUE UNAVAILABLE&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Its context-sensitive reset button displays:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RESET PRACTICE TRIAL&#039;&#039;&#039; during eligible practice trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET CURRENT TRIAL&#039;&#039;&#039; during eligible experimental trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET UNAVAILABLE&#039;&#039;&#039; when reset is not permitted.&lt;br /&gt;
&lt;br /&gt;
The current window also includes &#039;&#039;&#039;SKIP TRIAL&#039;&#039;&#039;, &#039;&#039;&#039;SKIP CURRENT BLOCK&#039;&#039;&#039;, &#039;&#039;&#039;SKIP INTRODUCTION&#039;&#039;&#039;, &#039;&#039;&#039;SKIP PRACTICE&#039;&#039;&#039;, &#039;&#039;&#039;SKIP SANDBOX&#039;&#039;&#039;, and &#039;&#039;&#039;PAUSE&#039;&#039;&#039;/&#039;&#039;&#039;RESUME&#039;&#039;&#039;. Controls are enabled only in the appropriate task context. Skipping the current block and skipping the introduction prompt for confirmation; the other skip controls act without a confirmation dialog.&lt;br /&gt;
&lt;br /&gt;
===Researcher Skip Controls===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control&lt;br /&gt;
! When available&lt;br /&gt;
! Behavior&lt;br /&gt;
! Recorded event&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SKIP TRIAL&#039;&#039;&#039;&lt;br /&gt;
| During an experimental trial before feedback, while not paused&lt;br /&gt;
| Immediately advances to the next trial (or finishes the run if it was the last trial). A new target is generated for the next trial. A skipped trial does not increment completed-trial or reset metrics. In a controlled trial the return-to-anchor behavior is retained as needed.&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SKIP CURRENT BLOCK&#039;&#039;&#039;&lt;br /&gt;
| During an experimental trial before feedback, while not paused; confirmation required&lt;br /&gt;
| Skips the remaining trials in the current block, advances to the next block or ends the run, and increments the overall trial-position counter by the number skipped. It does not count these trials as completed.&lt;br /&gt;
| &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SKIP INTRODUCTION&#039;&#039;&#039;&lt;br /&gt;
| During the tutorial, while not paused; confirmation required&lt;br /&gt;
| Exits the entire tutorial, restores the saved first experimental target, and enters the experimental block-announcement sequence.&lt;br /&gt;
| &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SKIP PRACTICE&#039;&#039;&#039;&lt;br /&gt;
| During an active practice trial, while not paused&lt;br /&gt;
| Ends the remaining practice trials for that practice condition. After Normal practice, proceeds to Reversed instructions if configured, otherwise tutorial completion; after Reversed practice, proceeds to completion.&lt;br /&gt;
| &amp;lt;code&amp;gt;PracticeSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SKIP SANDBOX&#039;&#039;&#039;&lt;br /&gt;
| During Normal or Reversed free movement, while not paused&lt;br /&gt;
| Ends the free-movement stage and proceeds to the appropriate next instructions, practice stage, or completion screen.&lt;br /&gt;
| &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each skip event is written as a one-processing-block state pulse and is cleared at the beginning of the next processing block. Skip actions can bypass the regular end-of-&amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; state synchronization. Therefore, the event pulse may precede the updated &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;, target, or cursor states by one processing block. If a skip ends the entire run, the last recorded phase/trial values may retain their pre-skip values rather than representing the usual Finished-phase state. Offline analyses should therefore use the event states, not rely solely on a simultaneous change in other states.&lt;br /&gt;
&lt;br /&gt;
===Pause and Resume===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;PAUSE&#039;&#039;&#039;/&#039;&#039;&#039;RESUME&#039;&#039;&#039; control is available during both tutorial and experimental portions of the run, but not after the task finishes.&lt;br /&gt;
&lt;br /&gt;
* Pausing sets &amp;lt;code&amp;gt;TaskPaused=1&amp;lt;/code&amp;gt;. Task trial and cursor progression stop, but the BCI2000 stream continues to record samples with the pause state high.&lt;br /&gt;
* Resuming sets &amp;lt;code&amp;gt;TaskPaused=0&amp;lt;/code&amp;gt;. The program shifts the applicable phase, tutorial, target-onset, and movement-onset clocks forward by the paused duration.&lt;br /&gt;
* Paused time is excluded from the application&#039;s reaction time, movement time, total time, and active phase durations.&lt;br /&gt;
* Researcher skip actions are unavailable while paused.&lt;br /&gt;
&lt;br /&gt;
A paused BCI2000 recording is not the same as a stopped BCI2000 run. Analysts should explicitly account for samples with &amp;lt;code&amp;gt;TaskPaused=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
Experimental trials may be manually reset before they reach the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting an experimental trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the experimental diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not generate a successful-trial event or count as a completed experimental trial.&lt;br /&gt;
&lt;br /&gt;
Practice trials may also be reset before feedback.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the practice trial to the waiting-for-center phase.&lt;br /&gt;
* Clears movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Keeps the same &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* Keeps the same deterministic target.&lt;br /&gt;
* Does not increment experimental reset metrics.&lt;br /&gt;
* Does not increment experimental completed-trial metrics.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during tutorial instruction/free-movement screens and after a trial has entered feedback. Resetting a controlled trial after its target is visible also enables return-to-anchor handling so that resuming normal cursor control does not produce an abrupt jump. Reset preserves the current trial and its target, whereas &#039;&#039;&#039;SKIP TRIAL&#039;&#039;&#039; advances to a new one.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for successfully completed practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
Practice timing values are recorded in the BCI2000 states but are excluded from experimental timing summaries. The task writes no application-specific CSV. When the researcher pauses the task, clock offsets are adjusted on resume so that the reported RT, MT, and total time exclude the paused interval, even though the paused samples remain in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral and tutorial variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
Tutorial and practice samples are part of the same BCI2000 run as the experiment. The &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state should therefore be used when separating tutorial/practice data from experimental data during offline analysis.&lt;br /&gt;
&lt;br /&gt;
Practice trials record:&lt;br /&gt;
&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Target coordinates and angle.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Practice condition.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Practice reset events.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
&lt;br /&gt;
Practice trials are intentionally excluded from:&lt;br /&gt;
&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Automatic and controlled completion counts.&lt;br /&gt;
* Automatic and controlled reset counts.&lt;br /&gt;
* Mean reaction-time summaries.&lt;br /&gt;
* Mean movement-time summaries.&lt;br /&gt;
* Mean total-time summaries.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;No secondary results file is created by this application in the current version.&#039;&#039;&#039; The &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter and trial-level CSV writer were removed. All per-trial behavioral information must be reconstructed from the recorded BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; states; joystick state recording additionally depends on the normal &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; configuration.&lt;br /&gt;
&lt;br /&gt;
Researcher skip events (&amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt;) and the persistent &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; state are also recorded. They identify deviations from ordinary trial/tutorial progression and samples recorded during pause.&lt;br /&gt;
&lt;br /&gt;
The application writes BCI2000 console messages when the task starts and stops and when practice or experimental trials succeed. Messages include the applicable trial/condition and reaction/movement times; these console messages are not an additional trial-level results file and should not be treated as synchronized state data.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
Parameters for experimental structure, timing, and display are grouped under &amp;lt;code&amp;gt;Application:USBHIDJoystick&amp;lt;/code&amp;gt; in the BCI2000 parameter tree. &amp;lt;code&amp;gt;EnableIntroduction&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AutomaticPracticeTrials&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ControlledPracticeTrials&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; are grouped under &amp;lt;code&amp;gt;Application:Introduction&amp;lt;/code&amp;gt;. Existing parameter files should use the current group definitions.&lt;br /&gt;
&lt;br /&gt;
===EnableIntroduction===&lt;br /&gt;
&lt;br /&gt;
Enables or disables the participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
Type: integer boolean&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Skip the tutorial and begin the experiment normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Run the tutorial and practice sequence before the experiment.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to all experiment modes.&lt;br /&gt;
&lt;br /&gt;
===AutomaticPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains automatic trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips automatic practice trials while retaining the automatic instruction page.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===ControlledPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains controlled trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips controlled practice trials. The controlled instruction page and controlled free-movement demonstration are still presented.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===PracticeCenterHoldTime===&lt;br /&gt;
&lt;br /&gt;
Center-hold duration used during automatic and controlled practice trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating-point time&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0s-60s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This parameter replaces &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt; during practice trials only.&lt;br /&gt;
&lt;br /&gt;
Experimental trials continue to use &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
The selected mode also determines which condition-specific tutorial sections are presented when &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic experimental trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled experimental trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which experimental condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
It also does not affect tutorial order. When both conditions are included, the tutorial always presents automatic training before controlled training.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter does not control practice center-hold duration. Practice trials use &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial, tutorial transition, or experimental block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===CursorDiameterPixels===&lt;br /&gt;
&lt;br /&gt;
Cursor diameter, expressed in reference-display pixels and converted to normalized rendering dimensions during initialization.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;16.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1.0-1000.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A positive value is required by preflight validation.&lt;br /&gt;
&lt;br /&gt;
===TargetDiameterPixels===&lt;br /&gt;
&lt;br /&gt;
Target diameter, expressed in reference-display pixels and converted to normalized rendering dimensions during initialization.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;36.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1.0-1000.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A positive value is required by preflight validation. In addition to determining visual size, this parameter affects the ellipse used to determine target acquisition. Consequently, changing it can change the effective movement tolerance and behavioral measurements.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter was removed; see [[#Data Recording|Data Recording]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether the participant tutorial/practice sequence is active.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive or disabled; experimental data&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Tutorial or practice sequence active&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, this state becomes 1 at the beginning of the run and returns to 0 when the tutorial completes and the experiment begins.&lt;br /&gt;
&lt;br /&gt;
This is the primary state for separating tutorial/practice samples from experimental samples during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TutorialPhase===&lt;br /&gt;
&lt;br /&gt;
4-bit state indicating the current stage of the tutorial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: General introduction&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Normal free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Automatic instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Automatic practice&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Controlled instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Controlled free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Controlled practice&lt;br /&gt;
* &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;: Practice complete&lt;br /&gt;
&lt;br /&gt;
After the final automatic or controlled practice feedback interval, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; may remain 4 or 7 while &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; has returned to 0 and the task waits for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Outside the tutorial, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
===PracticeTrial===&lt;br /&gt;
&lt;br /&gt;
8-bit state identifying the active practice trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: No active practice trial&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: One-based practice trial number within the current practice condition&lt;br /&gt;
&lt;br /&gt;
The state remains nonzero through the practice trial&#039;s feedback phase.&lt;br /&gt;
&lt;br /&gt;
After the final practice feedback interval it returns to 0 while the tutorial may still wait for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial does not increment &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current trial phase.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Experimental block announcement or non-trial tutorial screen&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
During active practice trials, values 1 through 6 have the same meanings as during experimental trials.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is forced to 0. Therefore, &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; alone no longer uniquely identifies an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
Use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0 and TaskPhase == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to identify an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic (participant-facing &#039;&#039;&#039;Normal&#039;&#039;&#039;)&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled (participant-facing &#039;&#039;&#039;Reversed&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
During active practice trials, this state identifies the practice condition.&lt;br /&gt;
&lt;br /&gt;
During the general introduction and normal free-movement tutorial stages, it initially reports 0 even when the configured experiment is Controlled Only.&lt;br /&gt;
&lt;br /&gt;
During the experiment it retains its original meaning.&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current experimental block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
During the tutorial, this state is forced to 0. It should therefore only be interpreted as an experimental block type when &amp;lt;code&amp;gt;Introduction=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During experimental trials, generated values range from &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During practice trials, the state contains the deterministic practice-target angle.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is set to 0.&lt;br /&gt;
&lt;br /&gt;
After tutorial completion, the saved first experimental target is restored.&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the target coordinate is written as &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; rather than retaining its initial value &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;; gate it by task phase and tutorial status during analysis.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the target coordinate is written as &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; rather than retaining its initial value &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;; gate it by task phase and tutorial status during analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based experimental block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental block begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental block numbers.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall experimental trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental trial begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across experimental block boundaries. Manually resetting an experimental trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental trial numbers.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current active practice or experimental trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 identifies movement onset.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is forced to 0.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish practice movement onset from experimental movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches a practice or experimental target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
Experimental acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets a practice or experimental trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
Experimental reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrialSkipped===&lt;br /&gt;
&lt;br /&gt;
1-bit event state for the researcher&#039;s &#039;&#039;&#039;SKIP TRIAL&#039;&#039;&#039; command during an eligible experimental trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when an experimental trial is skipped and cleared on the following processing block. Skipping advances trial position without counting a successful target acquisition and without increasing completed/reset metrics. The next trial receives a newly generated target, unless the run ends.&lt;br /&gt;
&lt;br /&gt;
===ConditionSkipped===&lt;br /&gt;
&lt;br /&gt;
1-bit event state for the researcher&#039;s &#039;&#039;&#039;SKIP CURRENT BLOCK&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 for one processing block when the remainder of the current experimental block is skipped. This command advances the overall trial-position counter over the skipped trials, which can change the progress indicator without changing completed-trial counts. The control requires experimenter confirmation.&lt;br /&gt;
&lt;br /&gt;
===IntroductionSkipped===&lt;br /&gt;
&lt;br /&gt;
1-bit event state for the researcher&#039;s &#039;&#039;&#039;SKIP INTRODUCTION&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 for one processing block when the tutorial is exited before normal completion. The current run proceeds directly to the experimental block-announcement sequence and restores the saved first experimental target. This control requires confirmation.&lt;br /&gt;
&lt;br /&gt;
===PracticeSkipped===&lt;br /&gt;
&lt;br /&gt;
1-bit event state for the researcher&#039;s &#039;&#039;&#039;SKIP PRACTICE&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 for one processing block when the remaining trials in the current practice condition are bypassed. It identifies incomplete tutorial practice and is distinct from experimental &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===SandboxSkipped===&lt;br /&gt;
&lt;br /&gt;
1-bit event state for the researcher&#039;s &#039;&#039;&#039;SKIP SANDBOX&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 for one processing block when a Normal or Reversed free-movement sandbox is bypassed. The tutorial advances to the appropriate next stage.&lt;br /&gt;
&lt;br /&gt;
===TaskPaused===&lt;br /&gt;
&lt;br /&gt;
1-bit persistent (level) state showing whether the task is paused.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Task running normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Task paused; task progression is suspended, while the BCI2000 data stream continues.&lt;br /&gt;
&lt;br /&gt;
Unlike the five skip states, &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; remains high throughout a pause and returns to 0 on resume. Paused time is excluded from the task&#039;s reported timing intervals by shifting the relevant clock references on resume.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. During the tutorial, a rising press may advance eligible instruction or free-movement screens. It does not advance active practice trials and does not control experimental progression.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
Because the tutorial and practice sequence are recorded within the same BCI2000 run as the experiment, analyses should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish experimental data from tutorial and practice data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! Recommended identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Tutorial/practice samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;; check skip events when reconstructing completed trials&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block announcement&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Non-trial tutorial screen&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, typically with &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;, interpreted together with &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt; on actual trials; non-trial tutorial screens set these to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Skipped experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Skipped experimental block remainder&lt;br /&gt;
| &amp;lt;code&amp;gt;ConditionSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction bypassed&lt;br /&gt;
| &amp;lt;code&amp;gt;IntroductionSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice bypassed&lt;br /&gt;
| &amp;lt;code&amp;gt;PracticeSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Free-movement sandbox bypassed&lt;br /&gt;
| &amp;lt;code&amp;gt;SandboxSkipped == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Samples recorded while the task is paused&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPaused == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TrialSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;IntroductionSkipped&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeSkipped&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;SandboxSkipped&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; remains high after movement onset until the trial advances or is reset. &amp;lt;code&amp;gt;TaskPaused&amp;lt;/code&amp;gt; is a level state that remains high throughout a pause.&lt;br /&gt;
&lt;br /&gt;
Analyses written for earlier versions of the task should be updated before use with tutorial-enabled data. In particular:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; no longer always identifies an experimental block announcement.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt; may indicate a practice or experimental success.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt; may indicate a practice or experimental reset.&lt;br /&gt;
* Nonzero timing states may belong to practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; should not be interpreted as experimental condition/block variables while &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Skip events mark incomplete trials or tutorial stages; skipped experimental trials do not produce &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; or increase completed-trial metrics.&lt;br /&gt;
* &amp;lt;code&amp;gt;ConditionSkipped&amp;lt;/code&amp;gt; can cause the progress indicator and overall trial-position counter to jump across uncompleted trials.&lt;br /&gt;
* On a skip processing block, non-event states such as &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;, and target coordinates may not update until the following block because skip dispatch returns before the normal state synchronization. A skip that finishes the run can leave final values at their pre-skip settings.&lt;br /&gt;
* Samples recorded during &amp;lt;code&amp;gt;TaskPaused=1&amp;lt;/code&amp;gt; remain in the &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; stream. Exclude or flag them as appropriate; RT/MT/total-time values already exclude the pause duration.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt; are 0 during non-trial tutorial screens, not their initial 512 values.&lt;br /&gt;
* Condition names printed on screen and in console messages are Normal/Reversed, but the numeric &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; codes remain Automatic=0 and Controlled=1.&lt;br /&gt;
* No application-specific CSV is created in the current version; reconstruct trial-level results from synchronized BCI2000 state recordings.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;br /&gt;
* [[Category:User Application]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=BCI2000_to_BIDS_Converter&amp;diff=12608</id>
		<title>BCI2000 to BIDS Converter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=BCI2000_to_BIDS_Converter&amp;diff=12608"/>
		<updated>2026-09-29T00:03:34Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BCI2000 to BIDS Converter&#039;&#039;&#039; (&amp;lt;code&amp;gt;bci2000-bids&amp;lt;/code&amp;gt;) is an open-source Python tool for converting BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings into datasets organized according to the [https://bids.neuroimaging.io/ Brain Imaging Data Structure (BIDS)].&lt;br /&gt;
&lt;br /&gt;
The converter reads signals, parameters, state definitions, and state values stored in a BCI2000 data file and maps them into BIDS-compatible electrophysiology, event, motion, and metadata files.&lt;br /&gt;
&lt;br /&gt;
The converter supports:&lt;br /&gt;
&lt;br /&gt;
* Behavioral/state-only BIDS datasets.&lt;br /&gt;
* EEG datasets.&lt;br /&gt;
* Intracranial EEG (iEEG) datasets, including ECoG, SEEG, and DBS recordings.&lt;br /&gt;
* Conversion of BCI2000 signal channels to EDF.&lt;br /&gt;
* Conversion of BCI2000 state transitions into &amp;lt;code&amp;gt;*_events.tsv&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Conversion of continuous BCI2000 states into BIDS motion files.&lt;br /&gt;
* Reusable JSON or YAML state-routing profiles.&lt;br /&gt;
* Automatic generation of review-required starter profiles.&lt;br /&gt;
* Conversion of multiple &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files into sequential BIDS runs.&lt;br /&gt;
* Optional preservation of the original BCI2000 files in &amp;lt;code&amp;gt;sourcedata/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* SHA-256 checksums for preserved source recordings.&lt;br /&gt;
* Command-line and graphical interfaces.&lt;br /&gt;
* Optional validation using the [https://bids-standard.github.io/bids-validator/ BIDS Validator].&lt;br /&gt;
&lt;br /&gt;
The converter is intended for offline organization and export of data that have already been recorded by BCI2000. It does not modify the original &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings.&lt;br /&gt;
&lt;br /&gt;
==Project Source==&lt;br /&gt;
&lt;br /&gt;
The Python package and command-line program are named:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python import package is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000_bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/alexanderspeer/BCI2000-to-BIDS-Converter BCI2000 to BIDS Converter on GitHub]&lt;br /&gt;
&lt;br /&gt;
The converter relies on BCI2000Tools for reading BCI2000 recordings. See [[BCI2000Tools.EventRelated|BCI2000Tools]] for information about BCI2000&#039;s Python tools.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
Current software version: &#039;&#039;&#039;0.1.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial implementation provides:&lt;br /&gt;
&lt;br /&gt;
* Reading of BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings using BCI2000Tools.&lt;br /&gt;
* Single-file and multi-file conversion.&lt;br /&gt;
* Deterministic BIDS run numbering.&lt;br /&gt;
* Behavioral, EEG, and iEEG output.&lt;br /&gt;
* EDF electrophysiology output.&lt;br /&gt;
* BIDS event generation from BCI2000 states.&lt;br /&gt;
* BIDS motion output from continuous BCI2000 states.&lt;br /&gt;
* JSON and YAML state-routing profiles.&lt;br /&gt;
* Automatic starter-profile generation.&lt;br /&gt;
* Source-file preservation and SHA-256 checksums.&lt;br /&gt;
* Staged conversion and protected publication of output datasets.&lt;br /&gt;
* Command-line interface.&lt;br /&gt;
* Tkinter graphical interface.&lt;br /&gt;
* Optional BIDS validation.&lt;br /&gt;
&lt;br /&gt;
The software requires Python 3.10 or newer.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Data Model===&lt;br /&gt;
&lt;br /&gt;
A standard BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file contains the recorded signal together with BCI2000 parameters and states. See [[Technical Reference:BCI2000 File Format|BCI2000 File Format]] for the complete native format specification.&lt;br /&gt;
&lt;br /&gt;
The converter uses these components differently:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! BCI2000 information&lt;br /&gt;
! Use by the converter&lt;br /&gt;
|-&lt;br /&gt;
| Signal channels&lt;br /&gt;
| May be exported as BIDS EEG or iEEG electrophysiology data.&lt;br /&gt;
|-&lt;br /&gt;
| Sampling rate&lt;br /&gt;
| Used as the sampling frequency of the exported recording and motion data.&lt;br /&gt;
|-&lt;br /&gt;
| Channel names&lt;br /&gt;
| Used to name channels in the electrophysiology output.&lt;br /&gt;
|-&lt;br /&gt;
| Channel units&lt;br /&gt;
| Used when constructing the BIDS channel table and EDF output.&lt;br /&gt;
|-&lt;br /&gt;
| State definitions&lt;br /&gt;
| Used to identify states that may be mapped to events, event metadata, or continuous motion channels.&lt;br /&gt;
|-&lt;br /&gt;
| State samples&lt;br /&gt;
| Used to generate event timing and continuous motion data.&lt;br /&gt;
|-&lt;br /&gt;
| Parameters&lt;br /&gt;
| Used to obtain selected recording metadata such as sampling rate, channel names, channel units, application, signal source, and data format.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not every BCI2000 state or parameter is automatically exported. State routing is controlled by a conversion profile so that the scientific meaning of study-specific states remains under user control.&lt;br /&gt;
&lt;br /&gt;
===Conversion Pipeline===&lt;br /&gt;
&lt;br /&gt;
The overall conversion process is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BCI2000 .dat recording(s)&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
   BCI2000Tools reader&lt;br /&gt;
          |&lt;br /&gt;
          +---- signal channels&lt;br /&gt;
          |&lt;br /&gt;
          +---- parameters&lt;br /&gt;
          |&lt;br /&gt;
          +---- state definitions and values&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
 State-routing profile&lt;br /&gt;
          |&lt;br /&gt;
          +---- event states --------&amp;gt; *_events.tsv&lt;br /&gt;
          |&lt;br /&gt;
          +---- event metadata ------&amp;gt; additional event columns&lt;br /&gt;
          |&lt;br /&gt;
          +---- continuous states ---&amp;gt; motion/*.tsv&lt;br /&gt;
          |&lt;br /&gt;
          +---- ignored states&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
     BIDS writers&lt;br /&gt;
          |&lt;br /&gt;
          +---- EEG/iEEG EDF&lt;br /&gt;
          +---- channels.tsv&lt;br /&gt;
          +---- JSON sidecars&lt;br /&gt;
          +---- events.tsv&lt;br /&gt;
          +---- motion files&lt;br /&gt;
          +---- participants.tsv&lt;br /&gt;
          +---- dataset_description.json&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
   Optional BIDS validation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a normal conversion, the software:&lt;br /&gt;
&lt;br /&gt;
# Loads the optional conversion configuration.&lt;br /&gt;
# Resolves subject, session, task, datatype, neural-export, preservation, and output settings.&lt;br /&gt;
# Normalizes BIDS labels.&lt;br /&gt;
# Discovers input &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
# Sorts the files and assigns sequential BIDS run numbers.&lt;br /&gt;
# Loads the requested state-routing profile.&lt;br /&gt;
# If no profile is supplied, analyzes the first recording and generates a review-required starter profile.&lt;br /&gt;
# Creates a temporary staging dataset.&lt;br /&gt;
# Reads each BCI2000 recording.&lt;br /&gt;
# Extracts states referenced by the active profile.&lt;br /&gt;
# Generates BIDS events and/or motion data.&lt;br /&gt;
# Writes electrophysiology data if neural export is enabled.&lt;br /&gt;
# Optionally copies source data and calculates checksums.&lt;br /&gt;
# Optionally validates the staged BIDS dataset.&lt;br /&gt;
# Publishes the completed dataset.&lt;br /&gt;
&lt;br /&gt;
The original &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files are read-only during normal conversion.&lt;br /&gt;
&lt;br /&gt;
==Supported Input==&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Files===&lt;br /&gt;
&lt;br /&gt;
The converter accepts:&lt;br /&gt;
&lt;br /&gt;
* A single BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
* Multiple &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* A directory containing &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* A directory tree containing &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files when recursive discovery is enabled.&lt;br /&gt;
&lt;br /&gt;
For directory input, normal discovery searches the immediate directory.&lt;br /&gt;
&lt;br /&gt;
Recursive discovery may be enabled with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--recursive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input recordings are sorted deterministically. Each discovered recording becomes a separate BIDS run beginning with &amp;lt;code&amp;gt;run-01&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
recording1.dat  -&amp;gt; run-01&lt;br /&gt;
recording2.dat  -&amp;gt; run-02&lt;br /&gt;
recording3.dat  -&amp;gt; run-03&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converter does not currently infer recording groups from BCI2000 metadata. The supplied files are treated as recordings belonging to the subject/session/task selected for that conversion.&lt;br /&gt;
&lt;br /&gt;
Duplicate source filenames are rejected even if the files originate from different directories.&lt;br /&gt;
&lt;br /&gt;
===Reading BCI2000 Data===&lt;br /&gt;
&lt;br /&gt;
BCI2000 files are opened using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BCI2000Tools.FileReader.bcistream&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reader obtains:&lt;br /&gt;
&lt;br /&gt;
* Parameters.&lt;br /&gt;
* State definitions.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Number of samples.&lt;br /&gt;
* Number of channels.&lt;br /&gt;
* Channel names.&lt;br /&gt;
* Channel units.&lt;br /&gt;
&lt;br /&gt;
Signal and state arrays are decoded when required by the requested conversion.&lt;br /&gt;
&lt;br /&gt;
The sampling frequency is first obtained from the BCI2000 &amp;lt;code&amp;gt;SamplingRate&amp;lt;/code&amp;gt; parameter. If that cannot be interpreted, the sampling frequency reported by the BCI2000Tools stream is used.&lt;br /&gt;
&lt;br /&gt;
Channel names are normally obtained from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ChannelNames&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If valid channel names are unavailable, fallback names are generated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ch001&lt;br /&gt;
ch002&lt;br /&gt;
ch003&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Channel units are read from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SourceChUnits&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When units are unavailable for neural EDF output, the converter currently uses &amp;lt;code&amp;gt;uV&amp;lt;/code&amp;gt; as the fallback unit.&lt;br /&gt;
&lt;br /&gt;
The converter requests calibrated signal values from BCI2000Tools.&lt;br /&gt;
&lt;br /&gt;
===Companion Files===&lt;br /&gt;
&lt;br /&gt;
The current converter operates on information embedded in BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
It does not automatically ingest companion files such as separate parameter files, video files, imaging files, or other study-specific files.&lt;br /&gt;
&lt;br /&gt;
==BIDS Output==&lt;br /&gt;
&lt;br /&gt;
===Supported BIDS Datatypes===&lt;br /&gt;
&lt;br /&gt;
The converter currently supports:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Datatype&lt;br /&gt;
! Purpose&lt;br /&gt;
! Neural export&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;beh&amp;lt;/code&amp;gt;&lt;br /&gt;
| Behavioral/state-only data&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;eeg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scalp EEG recordings&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ieeg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Intracranial electrophysiology&lt;br /&gt;
| Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iEEG conversion, the neural channel type may be specified as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ECOG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SEEG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DBS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Channels beginning with &amp;lt;code&amp;gt;ECG&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;EKG&amp;lt;/code&amp;gt; are classified as ECG channels.&lt;br /&gt;
&lt;br /&gt;
===Generated Dataset Structure===&lt;br /&gt;
&lt;br /&gt;
A conversion containing iEEG, events, motion data, and preserved source data may produce a structure similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bids/&lt;br /&gt;
├── dataset_description.json&lt;br /&gt;
├── participants.tsv&lt;br /&gt;
├── participants.json&lt;br /&gt;
├── sub-001/&lt;br /&gt;
│   └── ses-01/&lt;br /&gt;
│       ├── ieeg/&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_ieeg.edf&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_ieeg.json&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_channels.tsv&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_events.tsv&lt;br /&gt;
│       │   └── sub-001_ses-01_task-motor_run-01_events.json&lt;br /&gt;
│       └── motion/&lt;br /&gt;
│           ├── sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.tsv&lt;br /&gt;
│           ├── sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.json&lt;br /&gt;
│           └── sub-001_ses-01_task-motor_run-01_tracksys-unknown_channels.tsv&lt;br /&gt;
├── sourcedata/&lt;br /&gt;
│   └── sub-001/&lt;br /&gt;
│       └── ses-01/&lt;br /&gt;
│           └── bci2000/&lt;br /&gt;
│               ├── recording.dat&lt;br /&gt;
│               └── checksums.tsv&lt;br /&gt;
└── code/&lt;br /&gt;
    └── bci2000-bids/&lt;br /&gt;
        └── auto-profile-motor.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;code/bci2000-bids/auto-profile-*.json&amp;lt;/code&amp;gt; file is generated only when automatic profile generation is used.&lt;br /&gt;
&lt;br /&gt;
Behavioral-only conversion does not create a placeholder electrophysiology file.&lt;br /&gt;
&lt;br /&gt;
===Dataset-Level Files===&lt;br /&gt;
&lt;br /&gt;
The converter creates or maintains:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dataset_description.json&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;participants.tsv&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;participants.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The generated dataset description identifies the dataset as raw BIDS data and records &amp;lt;code&amp;gt;bci2000-bids&amp;lt;/code&amp;gt; as conversion software.&lt;br /&gt;
&lt;br /&gt;
The implementation writes BIDS version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.10.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The participant table initially contains the BIDS participant identifier.&lt;br /&gt;
&lt;br /&gt;
Study-specific clinical information is not automatically inferred from BCI2000 recordings.&lt;br /&gt;
&lt;br /&gt;
==BCI2000 State Profiles==&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
&lt;br /&gt;
BCI2000 applications may define many study-specific states. Their names alone are not sufficient to determine their scientific meaning.&lt;br /&gt;
&lt;br /&gt;
For this reason, the converter uses a &#039;&#039;&#039;state-routing profile&#039;&#039;&#039; to determine how states should be represented in BIDS.&lt;br /&gt;
&lt;br /&gt;
Profiles may be written in:&lt;br /&gt;
&lt;br /&gt;
* JSON.&lt;br /&gt;
* YAML.&lt;br /&gt;
&lt;br /&gt;
A state may be assigned to:&lt;br /&gt;
&lt;br /&gt;
* An event.&lt;br /&gt;
* An additional event column.&lt;br /&gt;
* A continuous motion channel.&lt;br /&gt;
* The ignore list.&lt;br /&gt;
&lt;br /&gt;
A state should not be assigned to multiple routing categories.&lt;br /&gt;
&lt;br /&gt;
===Example Profile===&lt;br /&gt;
&lt;br /&gt;
A simple profile may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: generic-motion&lt;br /&gt;
&lt;br /&gt;
metadata:&lt;br /&gt;
  tracking_system: unknown&lt;br /&gt;
&lt;br /&gt;
events:&lt;br /&gt;
  Marker:&lt;br /&gt;
    strategy: rising_edge&lt;br /&gt;
    trial_type: marker&lt;br /&gt;
&lt;br /&gt;
motion:&lt;br /&gt;
  PositionX:&lt;br /&gt;
    column: position_x&lt;br /&gt;
    type: POSITION&lt;br /&gt;
    units: arbitrary&lt;br /&gt;
&lt;br /&gt;
ignore:&lt;br /&gt;
  - SourceTime&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Marker&amp;lt;/code&amp;gt; creates BIDS event rows.&lt;br /&gt;
* &amp;lt;code&amp;gt;PositionX&amp;lt;/code&amp;gt; becomes a continuous BIDS motion channel.&lt;br /&gt;
* &amp;lt;code&amp;gt;SourceTime&amp;lt;/code&amp;gt; is deliberately ignored.&lt;br /&gt;
&lt;br /&gt;
===Profile Validation===&lt;br /&gt;
&lt;br /&gt;
Profiles are checked before conversion.&lt;br /&gt;
&lt;br /&gt;
Invalid profiles include cases such as:&lt;br /&gt;
&lt;br /&gt;
* Invalid JSON or YAML.&lt;br /&gt;
* Unsupported event strategies.&lt;br /&gt;
* Duplicate state routing.&lt;br /&gt;
* Invalid event-column definitions.&lt;br /&gt;
* Duplicate event-column names.&lt;br /&gt;
* Reserved event-column names.&lt;br /&gt;
* Invalid motion definitions.&lt;br /&gt;
* Invalid metadata structures.&lt;br /&gt;
&lt;br /&gt;
The standard BIDS event fields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
onset&lt;br /&gt;
duration&lt;br /&gt;
trial_type&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
are reserved and cannot be redefined as custom event columns.&lt;br /&gt;
&lt;br /&gt;
==Automatic Profile Generation==&lt;br /&gt;
&lt;br /&gt;
If a profile is not supplied, the converter may inspect the first recording and create a starter profile.&lt;br /&gt;
&lt;br /&gt;
The automatic profile generator examines properties such as:&lt;br /&gt;
&lt;br /&gt;
* State name.&lt;br /&gt;
* State bit width.&lt;br /&gt;
* Minimum value.&lt;br /&gt;
* Maximum value.&lt;br /&gt;
* Number of unique values.&lt;br /&gt;
* Number of transitions.&lt;br /&gt;
* Transition fraction.&lt;br /&gt;
* Number of nonzero samples.&lt;br /&gt;
* Percentage of nonzero samples.&lt;br /&gt;
&lt;br /&gt;
States with names suggesting continuously varying signals such as joystick, cursor, gaze, position, or similar values may be proposed as motion channels.&lt;br /&gt;
&lt;br /&gt;
Low-cardinality or event-like states may be proposed as events.&lt;br /&gt;
&lt;br /&gt;
Internal-looking states such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SourceTime&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Recording&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
may be proposed for exclusion.&lt;br /&gt;
&lt;br /&gt;
Automatically generated profiles contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;review_required&amp;quot;: true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and are saved inside the BIDS dataset under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
code/bci2000-bids/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Automatically generated profiles are suggestions and should be reviewed before scientific use.&#039;&#039;&#039; The converter cannot determine the experimental meaning of a state from its name or numeric behavior alone.&lt;br /&gt;
&lt;br /&gt;
==Event Conversion==&lt;br /&gt;
&lt;br /&gt;
BCI2000 states may be converted into BIDS &amp;lt;code&amp;gt;*_events.tsv&amp;lt;/code&amp;gt; rows.&lt;br /&gt;
&lt;br /&gt;
The base event table contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
onset    duration    trial_type&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Onsets and durations are expressed in seconds.&lt;br /&gt;
&lt;br /&gt;
===Event Strategies===&lt;br /&gt;
&lt;br /&gt;
The following event strategies are supported:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Strategy&lt;br /&gt;
! Behavior&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rising_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event when the state changes from zero to nonzero.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;falling_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event when the state changes from nonzero to zero.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;change&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event whenever the state value changes.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;value_change&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event whenever the state value changes.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nonzero_change&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event when a transition results in a nonzero value.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;interval&amp;lt;/code&amp;gt;&lt;br /&gt;
| Treats each continuous nonzero period as an event interval.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Edge and value-change events have zero duration.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;interval&amp;lt;/code&amp;gt;, the duration corresponds to the length of the contiguous nonzero period.&lt;br /&gt;
&lt;br /&gt;
===Additional Event Columns===&lt;br /&gt;
&lt;br /&gt;
Other BCI2000 states may be mapped as additional columns associated with generated events.&lt;br /&gt;
&lt;br /&gt;
For example, a task may use one state to trigger an event while states such as condition, target, block, response type, or trial number are sampled at that event and placed into additional TSV columns.&lt;br /&gt;
&lt;br /&gt;
Additional nonstandard columns are described in the corresponding &amp;lt;code&amp;gt;*_events.json&amp;lt;/code&amp;gt; sidecar.&lt;br /&gt;
&lt;br /&gt;
An additional event-column mapping by itself does not create an event. An event rule must first define when event rows are generated.&lt;br /&gt;
&lt;br /&gt;
==Motion and Continuous State Conversion==&lt;br /&gt;
&lt;br /&gt;
Continuously varying BCI2000 states may be written to the BIDS &amp;lt;code&amp;gt;motion/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Examples may include states representing:&lt;br /&gt;
&lt;br /&gt;
* Joystick position.&lt;br /&gt;
* Cursor position.&lt;br /&gt;
* Eye position.&lt;br /&gt;
* Gaze position.&lt;br /&gt;
* Limb position.&lt;br /&gt;
* Other continuous task or kinematic variables.&lt;br /&gt;
&lt;br /&gt;
The converter does not determine these meanings automatically during normal conversion. The user specifies them through the state-routing profile.&lt;br /&gt;
&lt;br /&gt;
A typical motion output consists of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.tsv&lt;br /&gt;
sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.json&lt;br /&gt;
sub-001_ses-01_task-motor_run-01_tracksys-unknown_channels.tsv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The motion TSV is headerless.&lt;br /&gt;
&lt;br /&gt;
Column information is stored in the motion channels TSV:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name    type    units    description&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A motion mapping may define:&lt;br /&gt;
&lt;br /&gt;
* Column name.&lt;br /&gt;
* Motion type.&lt;br /&gt;
* Units.&lt;br /&gt;
* Description.&lt;br /&gt;
&lt;br /&gt;
The associated JSON sidecar records information such as:&lt;br /&gt;
&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Start time.&lt;br /&gt;
* Column order.&lt;br /&gt;
* Tracking-system name.&lt;br /&gt;
&lt;br /&gt;
All motion states in one output file must contain the same number of samples.&lt;br /&gt;
&lt;br /&gt;
==Neural Signal Conversion==&lt;br /&gt;
&lt;br /&gt;
When neural export is enabled, BCI2000 signal channels are exported as EDF.&lt;br /&gt;
&lt;br /&gt;
The converter currently supports:&lt;br /&gt;
&lt;br /&gt;
* EEG EDF output.&lt;br /&gt;
* iEEG EDF output.&lt;br /&gt;
&lt;br /&gt;
The BCI2000 signal matrix is read with calibration gains applied and converted into the orientation required by the output writer.&lt;br /&gt;
&lt;br /&gt;
A corresponding BIDS channel table contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name    type    units&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For EEG, channels normally use the BIDS channel type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EEG&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For iEEG, the channel type is selected from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ECOG&lt;br /&gt;
SEEG&lt;br /&gt;
DBS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The electrophysiology JSON sidecar includes information such as:&lt;br /&gt;
&lt;br /&gt;
* Task name.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Recording duration.&lt;br /&gt;
* Reference.&lt;br /&gt;
* Source system.&lt;br /&gt;
* Conversion software.&lt;br /&gt;
&lt;br /&gt;
The source system is identified as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BCI2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The conversion software is identified as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
&lt;br /&gt;
Python &#039;&#039;&#039;3.10 or newer&#039;&#039;&#039; is required.&lt;br /&gt;
&lt;br /&gt;
The primary Python dependencies are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;numpy&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pyEDFlib&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PyYAML&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;BCI2000Tools&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tkinter is required for the graphical interface.&lt;br /&gt;
&lt;br /&gt;
===Recommended Installation===&lt;br /&gt;
&lt;br /&gt;
From a local checkout of the repository, create a Python virtual environment.&lt;br /&gt;
&lt;br /&gt;
On macOS or Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python3 -m venv .venv&lt;br /&gt;
source .venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
python -m pip install --upgrade pip&lt;br /&gt;
python -m pip install -r requirements.txt&lt;br /&gt;
python -m pip install -e .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows PowerShell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
py -3.14 -m venv .venv&lt;br /&gt;
.venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
python -m pip install --upgrade pip&lt;br /&gt;
python -m pip install -r requirements.txt&lt;br /&gt;
python -m pip install -e .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package also defines installation extras for BCI2000 and YAML support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m pip install -e &amp;quot;.[yaml,bci2000]&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For development:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m pip install -e &amp;quot;.[yaml,bci2000,dev]&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu systems, Tkinter may need to be installed separately:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install python3-tk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The external BIDS Validator is not installed automatically with the Python package.&lt;br /&gt;
&lt;br /&gt;
==Graphical Interface==&lt;br /&gt;
&lt;br /&gt;
The graphical interface may be launched with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids-gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m bci2000_bids.gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may also be launched from the main command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI supports:&lt;br /&gt;
&lt;br /&gt;
* Selecting one or more &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* Selecting an input directory.&lt;br /&gt;
* Recursive input discovery.&lt;br /&gt;
* Selecting a BIDS output directory.&lt;br /&gt;
* Subject label entry.&lt;br /&gt;
* Session label entry.&lt;br /&gt;
* Task label entry.&lt;br /&gt;
* Behavioral, EEG, or iEEG datatype selection.&lt;br /&gt;
* ECoG, SEEG, or DBS iEEG channel-type selection.&lt;br /&gt;
* Enabling or disabling neural export.&lt;br /&gt;
* Loading an existing profile.&lt;br /&gt;
* Creating a profile using an interactive state-routing editor.&lt;br /&gt;
* Automatic starter-profile generation.&lt;br /&gt;
* Source preservation.&lt;br /&gt;
* SHA-256 checksum generation.&lt;br /&gt;
* Existing-output policy selection.&lt;br /&gt;
* Recording inspection.&lt;br /&gt;
* Dry runs.&lt;br /&gt;
* Conversion.&lt;br /&gt;
* Optional BIDS validation.&lt;br /&gt;
* Progress and status reporting.&lt;br /&gt;
&lt;br /&gt;
The default GUI configuration uses:&lt;br /&gt;
&lt;br /&gt;
* Session &amp;lt;code&amp;gt;01&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Datatype &amp;lt;code&amp;gt;beh&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Neural export disabled.&lt;br /&gt;
* BIDS validation enabled.&lt;br /&gt;
* Existing-output policy &amp;lt;code&amp;gt;error&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Interface==&lt;br /&gt;
&lt;br /&gt;
The command-line program is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equivalent module invocation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m bci2000_bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The primary commands are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
inspect&lt;br /&gt;
convert&lt;br /&gt;
profile&lt;br /&gt;
validate&lt;br /&gt;
gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inspect===&lt;br /&gt;
&lt;br /&gt;
To inspect one BCI2000 recording without converting it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids inspect recording.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inspection reports information including:&lt;br /&gt;
&lt;br /&gt;
* File name.&lt;br /&gt;
* Resolved path.&lt;br /&gt;
* Recording duration.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Number of channels.&lt;br /&gt;
* Number of samples.&lt;br /&gt;
* Channel names.&lt;br /&gt;
* State names.&lt;br /&gt;
* State bit widths.&lt;br /&gt;
* Selected BCI2000 parameters.&lt;br /&gt;
&lt;br /&gt;
Selected parameters include:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SamplingRate&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DataFormat&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Application&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SignalSource&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ChannelNames&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SourceChUnits&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generate a Profile===&lt;br /&gt;
&lt;br /&gt;
A starter state-routing profile may be generated with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids profile recording.dat --output profile.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; is omitted, the generated JSON profile is printed to standard output.&lt;br /&gt;
&lt;br /&gt;
The profile should be reviewed before conversion.&lt;br /&gt;
&lt;br /&gt;
===Basic Conversion===&lt;br /&gt;
&lt;br /&gt;
A basic iEEG conversion is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Behavioral/State-Only Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert states without neural data:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype beh \&lt;br /&gt;
  --no-neural \&lt;br /&gt;
  --profile profile.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Directory Conversion===&lt;br /&gt;
&lt;br /&gt;
To recursively discover BCI2000 files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert incoming/ \&lt;br /&gt;
  --output bids/ \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype eeg \&lt;br /&gt;
  --recursive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Source Preservation===&lt;br /&gt;
&lt;br /&gt;
To retain the original BCI2000 recordings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --profile profile.json \&lt;br /&gt;
  --preserve-source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Validation During Conversion===&lt;br /&gt;
&lt;br /&gt;
To run BIDS validation before publishing the converted dataset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --validate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dry Run===&lt;br /&gt;
&lt;br /&gt;
A conversion may be checked without publishing the final dataset using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--dry-run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dry run performs discovery, profile/configuration resolution, run assignment, and destination checking without publishing the final converted dataset.&lt;br /&gt;
&lt;br /&gt;
===Debug Logging===&lt;br /&gt;
&lt;br /&gt;
The global debugging option is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids --debug ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--debug&amp;lt;/code&amp;gt; must appear before the subcommand.&lt;br /&gt;
&lt;br /&gt;
==Typical Workflow==&lt;br /&gt;
&lt;br /&gt;
A typical command-line workflow is:&lt;br /&gt;
&lt;br /&gt;
===1. Inspect the recording===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids inspect recording.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===2. Generate a starter profile===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids profile recording.dat --output profile.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. Review the profile===&lt;br /&gt;
&lt;br /&gt;
Inspect the generated state mappings and confirm that each BCI2000 state has been assigned to the correct scientific role.&lt;br /&gt;
&lt;br /&gt;
In particular, confirm which states represent:&lt;br /&gt;
&lt;br /&gt;
* Experimental events.&lt;br /&gt;
* Event metadata.&lt;br /&gt;
* Continuous behavioral or motion signals.&lt;br /&gt;
* States that should be ignored.&lt;br /&gt;
&lt;br /&gt;
===4. Perform a dry run===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --profile profile.json \&lt;br /&gt;
  --dry-run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===5. Convert===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --profile profile.json \&lt;br /&gt;
  --preserve-source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===6. Validate===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids validate bids/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Files==&lt;br /&gt;
&lt;br /&gt;
In addition to state-routing profiles, general conversion settings may be stored in JSON or YAML configuration files.&lt;br /&gt;
&lt;br /&gt;
A configuration may contain fields such as:&lt;br /&gt;
&lt;br /&gt;
* Subject.&lt;br /&gt;
* Session.&lt;br /&gt;
* Task.&lt;br /&gt;
* Datatype.&lt;br /&gt;
* Neural export.&lt;br /&gt;
* iEEG channel type.&lt;br /&gt;
* Source preservation.&lt;br /&gt;
* Existing-output behavior.&lt;br /&gt;
* Profile path.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
subject: &amp;quot;001&amp;quot;&lt;br /&gt;
session: &amp;quot;01&amp;quot;&lt;br /&gt;
task: &amp;quot;motor&amp;quot;&lt;br /&gt;
datatype: &amp;quot;beh&amp;quot;&lt;br /&gt;
preserve_source: true&lt;br /&gt;
profile: &amp;quot;generic-motion.yaml&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A configuration may be supplied with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --config examples/configs/study.yaml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Command-line configuration handling is still under development. Explicit &amp;lt;code&amp;gt;--subject&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--task&amp;lt;/code&amp;gt; arguments should currently be supplied for reliable noninteractive CLI use.&lt;br /&gt;
&lt;br /&gt;
==Existing Output Handling==&lt;br /&gt;
&lt;br /&gt;
The converter protects existing BIDS data by default.&lt;br /&gt;
&lt;br /&gt;
The existing-output policy may be selected using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--on-existing&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Supported values are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Behavior&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;error&amp;lt;/code&amp;gt;&lt;br /&gt;
| Default. Stop if the target subject/session already exists.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;skip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Leave the existing subject/session unchanged and skip conversion.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;overwrite&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rebuild the requested subject/session while retaining other dataset content.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default policy is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Data Preservation==&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--preserve-source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is enabled, the original BCI2000 recording is copied to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourcedata/sub-&amp;lt;subject&amp;gt;/ses-&amp;lt;session&amp;gt;/bci2000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourcedata/sub-001/ses-01/bci2000/recording.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A SHA-256 checksum manifest is written as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourcedata/sub-001/ses-01/bci2000/checksums.tsv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with columns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
filename    sha256&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The preserved BCI2000 files are copies of the original recordings and are &#039;&#039;&#039;not anonymized by the converter&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Users should therefore review BCI2000 parameters and other source metadata before distributing &amp;lt;code&amp;gt;sourcedata/&amp;lt;/code&amp;gt; outside the research environment.&lt;br /&gt;
&lt;br /&gt;
==Data Safety==&lt;br /&gt;
&lt;br /&gt;
Conversions are built in a temporary staging directory rather than directly modifying the published BIDS dataset.&lt;br /&gt;
&lt;br /&gt;
When updating an existing dataset:&lt;br /&gt;
&lt;br /&gt;
# The current dataset is copied into a staging location.&lt;br /&gt;
# New conversion output is created in staging.&lt;br /&gt;
# Validation may be performed against the staged dataset.&lt;br /&gt;
# The original dataset is retained until processing succeeds.&lt;br /&gt;
# The staged dataset is moved into place after successful conversion.&lt;br /&gt;
&lt;br /&gt;
When replacement of an existing output root is necessary, the current output is temporarily renamed to a backup location before publication of the staged dataset.&lt;br /&gt;
&lt;br /&gt;
If publication fails, the converter attempts to restore the previous dataset.&lt;br /&gt;
&lt;br /&gt;
EDF files are also created through temporary output before final replacement.&lt;br /&gt;
&lt;br /&gt;
Additional input checks include rejection of:&lt;br /&gt;
&lt;br /&gt;
* Duplicate input basenames.&lt;br /&gt;
* Invalid subject labels.&lt;br /&gt;
* Invalid session labels.&lt;br /&gt;
* Invalid task labels.&lt;br /&gt;
* Invalid tracking-system names.&lt;br /&gt;
* Invalid iEEG channel types.&lt;br /&gt;
* Missing states required by a profile.&lt;br /&gt;
* Invalid signal dimensions.&lt;br /&gt;
* Duplicate or invalid EDF channel labels.&lt;br /&gt;
* Nonfinite neural samples.&lt;br /&gt;
* Certain EDF-incompatible signal conditions.&lt;br /&gt;
&lt;br /&gt;
==BIDS Validation==&lt;br /&gt;
&lt;br /&gt;
The converter includes an optional validation step.&lt;br /&gt;
&lt;br /&gt;
To validate an existing converted dataset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids validate bids/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converter first performs basic internal checks, including confirming that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dataset_description.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
exists and contains valid JSON.&lt;br /&gt;
&lt;br /&gt;
When available, it then invokes the external BIDS Validator.&lt;br /&gt;
&lt;br /&gt;
The [https://bids-standard.github.io/bids-validator/ official BIDS Validator] may also be used independently.&lt;br /&gt;
&lt;br /&gt;
When validation is enabled during conversion, validation occurs against the staged dataset before it is published. A validation failure therefore prevents the invalid staged conversion from replacing the existing output dataset.&lt;br /&gt;
&lt;br /&gt;
The external validator must currently be installed separately.&lt;br /&gt;
&lt;br /&gt;
==Clinical and Participant Metadata==&lt;br /&gt;
&lt;br /&gt;
The converter currently handles operational BIDS identifiers and recording metadata such as:&lt;br /&gt;
&lt;br /&gt;
* Participant identifier.&lt;br /&gt;
* Session identifier.&lt;br /&gt;
* Task.&lt;br /&gt;
* Datatype.&lt;br /&gt;
* Run number.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Recording duration.&lt;br /&gt;
* Channel names.&lt;br /&gt;
* Channel units.&lt;br /&gt;
* Neural channel type.&lt;br /&gt;
* Reference information.&lt;br /&gt;
* Motion tracking-system name.&lt;br /&gt;
&lt;br /&gt;
The converter does &#039;&#039;&#039;not&#039;&#039;&#039; currently automatically extract or request study-specific clinical metadata such as:&lt;br /&gt;
&lt;br /&gt;
* Diagnosis.&lt;br /&gt;
* Age.&lt;br /&gt;
* Sex.&lt;br /&gt;
* Handedness.&lt;br /&gt;
* Surgical procedure.&lt;br /&gt;
* Medication state.&lt;br /&gt;
* DBS stimulation state.&lt;br /&gt;
* Implant target.&lt;br /&gt;
* Recording location.&lt;br /&gt;
* Participant name.&lt;br /&gt;
* Medical record number.&lt;br /&gt;
* Date of birth.&lt;br /&gt;
&lt;br /&gt;
Such metadata must be handled separately when required by a study.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
&lt;br /&gt;
The current version is focused specifically on converting BCI2000 recordings and synchronized states into electrophysiology, behavioral, event, and motion components of BIDS.&lt;br /&gt;
&lt;br /&gt;
The following are not currently supported:&lt;br /&gt;
&lt;br /&gt;
* Imaging conversion.&lt;br /&gt;
* Video conversion.&lt;br /&gt;
* NeuroOmega file conversion.&lt;br /&gt;
* Automatic ingestion of BCI2000 companion files.&lt;br /&gt;
* Modalities other than &amp;lt;code&amp;gt;beh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;eeg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ieeg&amp;lt;/code&amp;gt;.&lt;br /&gt;
* BrainVision output.&lt;br /&gt;
* FIF output.&lt;br /&gt;
* NIfTI output.&lt;br /&gt;
* Automatic grouping of recordings using BCI2000 recording metadata.&lt;br /&gt;
* Comprehensive export of every BCI2000 parameter into BIDS metadata.&lt;br /&gt;
* Automatic extraction of clinical or surgical metadata.&lt;br /&gt;
* Automatic anonymization of preserved BCI2000 source files.&lt;br /&gt;
* Automatic generation of &amp;lt;code&amp;gt;.bidsignore&amp;lt;/code&amp;gt;.&lt;br /&gt;
* General provenance manifests beyond source checksums and generated conversion profiles.&lt;br /&gt;
&lt;br /&gt;
Automatic state classification is heuristic and should not be treated as a substitute for knowledge of the experiment.&lt;br /&gt;
&lt;br /&gt;
==Development and Testing==&lt;br /&gt;
&lt;br /&gt;
The project contains unit and integration tests for core conversion functionality.&lt;br /&gt;
&lt;br /&gt;
Current automated testing covers areas including:&lt;br /&gt;
&lt;br /&gt;
* BIDS dataset initialization.&lt;br /&gt;
* Dataset descriptions.&lt;br /&gt;
* Participant-table creation.&lt;br /&gt;
* BIDS label normalization.&lt;br /&gt;
* BIDS run naming.&lt;br /&gt;
* Rising-edge event generation.&lt;br /&gt;
* Interval event generation.&lt;br /&gt;
* State-change event generation.&lt;br /&gt;
* Motion TSV output.&lt;br /&gt;
* Motion channel definitions.&lt;br /&gt;
* Duplicate state-routing rejection.&lt;br /&gt;
* BCI2000 parameter parsing utilities.&lt;br /&gt;
* Deterministic input discovery.&lt;br /&gt;
* Recursive input discovery.&lt;br /&gt;
* Synthetic state/event conversion.&lt;br /&gt;
* Synthetic iEEG EDF conversion.&lt;br /&gt;
* EDF read-back using pyEDFlib.&lt;br /&gt;
* Missing-unit fallback behavior.&lt;br /&gt;
&lt;br /&gt;
The current integration tests use synthetic/mock BCI2000 recordings rather than decoding real clinical or experimental BCI2000 files.&lt;br /&gt;
&lt;br /&gt;
Real BCI2000 files should therefore be tested and reviewed in the intended research environment before relying on a new conversion workflow for production datasets.&lt;br /&gt;
&lt;br /&gt;
==BIDS Background==&lt;br /&gt;
&lt;br /&gt;
[https://bids.neuroimaging.io/ BIDS] is a community-developed standard for organizing neural and associated experimental data in a consistent filesystem structure.&lt;br /&gt;
&lt;br /&gt;
A typical BIDS hierarchy follows the general form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dataset/&lt;br /&gt;
└── sub-&amp;lt;subject&amp;gt;/&lt;br /&gt;
    └── ses-&amp;lt;session&amp;gt;/&lt;br /&gt;
        └── &amp;lt;datatype&amp;gt;/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within this structure, file names encode entities such as subject, session, task, and run.&lt;br /&gt;
&lt;br /&gt;
The BCI2000 to BIDS Converter performs this transformation automatically for supported BCI2000 data while retaining synchronization between neural signals and selected BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
For the complete standard, see the [https://bids-specification.readthedocs.io/en/stable/ BIDS Specification].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# Gorgolewski KJ, Auer T, Calhoun VD, et al. [https://doi.org/10.1038/sdata.2016.44 The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments]. &#039;&#039;Scientific Data&#039;&#039;. 2016;3:160044. doi:10.1038/sdata.2016.44.&lt;br /&gt;
# [https://bids.neuroimaging.io/ Brain Imaging Data Structure (BIDS)].&lt;br /&gt;
# [https://bids-specification.readthedocs.io/en/stable/ BIDS Specification].&lt;br /&gt;
# [https://bids-standard.github.io/bids-validator/ BIDS Validator].&lt;br /&gt;
# frederik-lam. [https://github.com/Cybernetics-and-Motor-Physiology-Lab/BCI2000-BIDS_converter BCI2000-BIDS_converter]. Cybernetics-and-Motor-Physiology-Lab. MATLAB-based framework for converting BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings into BIDS-compatible electrophysiology datasets.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[User Reference:BCI2000Export|BCI2000Export]]&lt;br /&gt;
* [[User Reference:Command Line Processing|BCI2000 Command Line Processing]]&lt;br /&gt;
* [[BCI2000Tools.EventRelated|BCI2000Tools and Python Data Analysis]]&lt;br /&gt;
* [[User Tutorial:Data Analysis|BCI2000 Data Analysis Tutorials]]&lt;br /&gt;
* [https://bids.neuroimaging.io/ Brain Imaging Data Structure]&lt;br /&gt;
* [https://bids-specification.readthedocs.io/en/stable/ BIDS Specification]&lt;br /&gt;
* [https://bids-standard.github.io/bids-validator/ BIDS Validator]&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Analysis Tools]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=BCI2000_to_BIDS_Converter&amp;diff=12607</id>
		<title>BCI2000 to BIDS Converter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=BCI2000_to_BIDS_Converter&amp;diff=12607"/>
		<updated>2026-09-28T23:58:39Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: Created page with &amp;quot;==Synopsis==  &amp;#039;&amp;#039;&amp;#039;BCI2000 to BIDS Converter&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;bci2000-bids&amp;lt;/code&amp;gt;) is an open-source Python tool for converting BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings into datasets organized according to the [https://bids.neuroimaging.io/ Brain Imaging Data Structure (BIDS)].  The converter reads signals, parameters, state definitions, and state values stored in a BCI2000 data file and maps them into BIDS-compatible electrophysiology, event, motion, and metadata files.  The convert...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BCI2000 to BIDS Converter&#039;&#039;&#039; (&amp;lt;code&amp;gt;bci2000-bids&amp;lt;/code&amp;gt;) is an open-source Python tool for converting BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings into datasets organized according to the [https://bids.neuroimaging.io/ Brain Imaging Data Structure (BIDS)].&lt;br /&gt;
&lt;br /&gt;
The converter reads signals, parameters, state definitions, and state values stored in a BCI2000 data file and maps them into BIDS-compatible electrophysiology, event, motion, and metadata files.&lt;br /&gt;
&lt;br /&gt;
The converter supports:&lt;br /&gt;
&lt;br /&gt;
* Behavioral/state-only BIDS datasets.&lt;br /&gt;
* EEG datasets.&lt;br /&gt;
* Intracranial EEG (iEEG) datasets, including ECoG, SEEG, and DBS recordings.&lt;br /&gt;
* Conversion of BCI2000 signal channels to EDF.&lt;br /&gt;
* Conversion of BCI2000 state transitions into &amp;lt;code&amp;gt;*_events.tsv&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Conversion of continuous BCI2000 states into BIDS motion files.&lt;br /&gt;
* Reusable JSON or YAML state-routing profiles.&lt;br /&gt;
* Automatic generation of review-required starter profiles.&lt;br /&gt;
* Conversion of multiple &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files into sequential BIDS runs.&lt;br /&gt;
* Optional preservation of the original BCI2000 files in &amp;lt;code&amp;gt;sourcedata/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* SHA-256 checksums for preserved source recordings.&lt;br /&gt;
* Command-line and graphical interfaces.&lt;br /&gt;
* Optional validation using the [https://bids-standard.github.io/bids-validator/ BIDS Validator].&lt;br /&gt;
&lt;br /&gt;
The converter is intended for offline organization and export of data that have already been recorded by BCI2000. It does not modify the original &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings.&lt;br /&gt;
&lt;br /&gt;
==Project Source==&lt;br /&gt;
&lt;br /&gt;
The Python package and command-line program are named:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python import package is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000_bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Add the public source-code repository URL here when the repository is published. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converter relies on BCI2000Tools for reading BCI2000 recordings. See [[BCI2000Tools.EventRelated|BCI2000Tools]] for information about BCI2000&#039;s Python tools.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
Current software version: &#039;&#039;&#039;0.1.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial implementation provides:&lt;br /&gt;
&lt;br /&gt;
* Reading of BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recordings using BCI2000Tools.&lt;br /&gt;
* Single-file and multi-file conversion.&lt;br /&gt;
* Deterministic BIDS run numbering.&lt;br /&gt;
* Behavioral, EEG, and iEEG output.&lt;br /&gt;
* EDF electrophysiology output.&lt;br /&gt;
* BIDS event generation from BCI2000 states.&lt;br /&gt;
* BIDS motion output from continuous BCI2000 states.&lt;br /&gt;
* JSON and YAML state-routing profiles.&lt;br /&gt;
* Automatic starter-profile generation.&lt;br /&gt;
* Source-file preservation and SHA-256 checksums.&lt;br /&gt;
* Staged conversion and protected publication of output datasets.&lt;br /&gt;
* Command-line interface.&lt;br /&gt;
* Tkinter graphical interface.&lt;br /&gt;
* Optional BIDS validation.&lt;br /&gt;
&lt;br /&gt;
The software requires Python 3.10 or newer.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Data Model===&lt;br /&gt;
&lt;br /&gt;
A standard BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file contains the recorded signal together with BCI2000 parameters and states. See [[Technical Reference:BCI2000 File Format|BCI2000 File Format]] for the complete native format specification.&lt;br /&gt;
&lt;br /&gt;
The converter uses these components differently:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! BCI2000 information&lt;br /&gt;
! Use by the converter&lt;br /&gt;
|-&lt;br /&gt;
| Signal channels&lt;br /&gt;
| May be exported as BIDS EEG or iEEG electrophysiology data.&lt;br /&gt;
|-&lt;br /&gt;
| Sampling rate&lt;br /&gt;
| Used as the sampling frequency of the exported recording and motion data.&lt;br /&gt;
|-&lt;br /&gt;
| Channel names&lt;br /&gt;
| Used to name channels in the electrophysiology output.&lt;br /&gt;
|-&lt;br /&gt;
| Channel units&lt;br /&gt;
| Used when constructing the BIDS channel table and EDF output.&lt;br /&gt;
|-&lt;br /&gt;
| State definitions&lt;br /&gt;
| Used to identify states that may be mapped to events, event metadata, or continuous motion channels.&lt;br /&gt;
|-&lt;br /&gt;
| State samples&lt;br /&gt;
| Used to generate event timing and continuous motion data.&lt;br /&gt;
|-&lt;br /&gt;
| Parameters&lt;br /&gt;
| Used to obtain selected recording metadata such as sampling rate, channel names, channel units, application, signal source, and data format.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not every BCI2000 state or parameter is automatically exported. State routing is controlled by a conversion profile so that the scientific meaning of study-specific states remains under user control.&lt;br /&gt;
&lt;br /&gt;
===Conversion Pipeline===&lt;br /&gt;
&lt;br /&gt;
The overall conversion process is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BCI2000 .dat recording(s)&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
   BCI2000Tools reader&lt;br /&gt;
          |&lt;br /&gt;
          +---- signal channels&lt;br /&gt;
          |&lt;br /&gt;
          +---- parameters&lt;br /&gt;
          |&lt;br /&gt;
          +---- state definitions and values&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
 State-routing profile&lt;br /&gt;
          |&lt;br /&gt;
          +---- event states --------&amp;gt; *_events.tsv&lt;br /&gt;
          |&lt;br /&gt;
          +---- event metadata ------&amp;gt; additional event columns&lt;br /&gt;
          |&lt;br /&gt;
          +---- continuous states ---&amp;gt; motion/*.tsv&lt;br /&gt;
          |&lt;br /&gt;
          +---- ignored states&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
     BIDS writers&lt;br /&gt;
          |&lt;br /&gt;
          +---- EEG/iEEG EDF&lt;br /&gt;
          +---- channels.tsv&lt;br /&gt;
          +---- JSON sidecars&lt;br /&gt;
          +---- events.tsv&lt;br /&gt;
          +---- motion files&lt;br /&gt;
          +---- participants.tsv&lt;br /&gt;
          +---- dataset_description.json&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
   Optional BIDS validation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a normal conversion, the software:&lt;br /&gt;
&lt;br /&gt;
# Loads the optional conversion configuration.&lt;br /&gt;
# Resolves subject, session, task, datatype, neural-export, preservation, and output settings.&lt;br /&gt;
# Normalizes BIDS labels.&lt;br /&gt;
# Discovers input &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
# Sorts the files and assigns sequential BIDS run numbers.&lt;br /&gt;
# Loads the requested state-routing profile.&lt;br /&gt;
# If no profile is supplied, analyzes the first recording and generates a review-required starter profile.&lt;br /&gt;
# Creates a temporary staging dataset.&lt;br /&gt;
# Reads each BCI2000 recording.&lt;br /&gt;
# Extracts states referenced by the active profile.&lt;br /&gt;
# Generates BIDS events and/or motion data.&lt;br /&gt;
# Writes electrophysiology data if neural export is enabled.&lt;br /&gt;
# Optionally copies source data and calculates checksums.&lt;br /&gt;
# Optionally validates the staged BIDS dataset.&lt;br /&gt;
# Publishes the completed dataset.&lt;br /&gt;
&lt;br /&gt;
The original &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files are read-only during normal conversion.&lt;br /&gt;
&lt;br /&gt;
==Supported Input==&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Files===&lt;br /&gt;
&lt;br /&gt;
The converter accepts:&lt;br /&gt;
&lt;br /&gt;
* A single BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
* Multiple &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* A directory containing &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* A directory tree containing &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files when recursive discovery is enabled.&lt;br /&gt;
&lt;br /&gt;
For directory input, normal discovery searches the immediate directory.&lt;br /&gt;
&lt;br /&gt;
Recursive discovery may be enabled with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--recursive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input recordings are sorted deterministically. Each discovered recording becomes a separate BIDS run beginning with &amp;lt;code&amp;gt;run-01&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
recording1.dat  -&amp;gt; run-01&lt;br /&gt;
recording2.dat  -&amp;gt; run-02&lt;br /&gt;
recording3.dat  -&amp;gt; run-03&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converter does not currently infer recording groups from BCI2000 metadata. The supplied files are treated as recordings belonging to the subject/session/task selected for that conversion.&lt;br /&gt;
&lt;br /&gt;
Duplicate source filenames are rejected even if the files originate from different directories.&lt;br /&gt;
&lt;br /&gt;
===Reading BCI2000 Data===&lt;br /&gt;
&lt;br /&gt;
BCI2000 files are opened using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BCI2000Tools.FileReader.bcistream&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reader obtains:&lt;br /&gt;
&lt;br /&gt;
* Parameters.&lt;br /&gt;
* State definitions.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Number of samples.&lt;br /&gt;
* Number of channels.&lt;br /&gt;
* Channel names.&lt;br /&gt;
* Channel units.&lt;br /&gt;
&lt;br /&gt;
Signal and state arrays are decoded when required by the requested conversion.&lt;br /&gt;
&lt;br /&gt;
The sampling frequency is first obtained from the BCI2000 &amp;lt;code&amp;gt;SamplingRate&amp;lt;/code&amp;gt; parameter. If that cannot be interpreted, the sampling frequency reported by the BCI2000Tools stream is used.&lt;br /&gt;
&lt;br /&gt;
Channel names are normally obtained from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ChannelNames&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If valid channel names are unavailable, fallback names are generated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ch001&lt;br /&gt;
ch002&lt;br /&gt;
ch003&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Channel units are read from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SourceChUnits&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When units are unavailable for neural EDF output, the converter currently uses &amp;lt;code&amp;gt;uV&amp;lt;/code&amp;gt; as the fallback unit.&lt;br /&gt;
&lt;br /&gt;
The converter requests calibrated signal values from BCI2000Tools.&lt;br /&gt;
&lt;br /&gt;
===Companion Files===&lt;br /&gt;
&lt;br /&gt;
The current converter operates on information embedded in BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
It does not automatically ingest companion files such as separate parameter files, video files, imaging files, or other study-specific files.&lt;br /&gt;
&lt;br /&gt;
==BIDS Output==&lt;br /&gt;
&lt;br /&gt;
===Supported BIDS Datatypes===&lt;br /&gt;
&lt;br /&gt;
The converter currently supports:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Datatype&lt;br /&gt;
! Purpose&lt;br /&gt;
! Neural export&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;beh&amp;lt;/code&amp;gt;&lt;br /&gt;
| Behavioral/state-only data&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;eeg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scalp EEG recordings&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ieeg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Intracranial electrophysiology&lt;br /&gt;
| Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iEEG conversion, the neural channel type may be specified as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ECOG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SEEG&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DBS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Channels beginning with &amp;lt;code&amp;gt;ECG&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;EKG&amp;lt;/code&amp;gt; are classified as ECG channels.&lt;br /&gt;
&lt;br /&gt;
===Generated Dataset Structure===&lt;br /&gt;
&lt;br /&gt;
A conversion containing iEEG, events, motion data, and preserved source data may produce a structure similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bids/&lt;br /&gt;
├── dataset_description.json&lt;br /&gt;
├── participants.tsv&lt;br /&gt;
├── participants.json&lt;br /&gt;
├── sub-001/&lt;br /&gt;
│   └── ses-01/&lt;br /&gt;
│       ├── ieeg/&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_ieeg.edf&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_ieeg.json&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_channels.tsv&lt;br /&gt;
│       │   ├── sub-001_ses-01_task-motor_run-01_events.tsv&lt;br /&gt;
│       │   └── sub-001_ses-01_task-motor_run-01_events.json&lt;br /&gt;
│       └── motion/&lt;br /&gt;
│           ├── sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.tsv&lt;br /&gt;
│           ├── sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.json&lt;br /&gt;
│           └── sub-001_ses-01_task-motor_run-01_tracksys-unknown_channels.tsv&lt;br /&gt;
├── sourcedata/&lt;br /&gt;
│   └── sub-001/&lt;br /&gt;
│       └── ses-01/&lt;br /&gt;
│           └── bci2000/&lt;br /&gt;
│               ├── recording.dat&lt;br /&gt;
│               └── checksums.tsv&lt;br /&gt;
└── code/&lt;br /&gt;
    └── bci2000-bids/&lt;br /&gt;
        └── auto-profile-motor.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;code/bci2000-bids/auto-profile-*.json&amp;lt;/code&amp;gt; file is generated only when automatic profile generation is used.&lt;br /&gt;
&lt;br /&gt;
Behavioral-only conversion does not create a placeholder electrophysiology file.&lt;br /&gt;
&lt;br /&gt;
===Dataset-Level Files===&lt;br /&gt;
&lt;br /&gt;
The converter creates or maintains:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dataset_description.json&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;participants.tsv&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;participants.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The generated dataset description identifies the dataset as raw BIDS data and records &amp;lt;code&amp;gt;bci2000-bids&amp;lt;/code&amp;gt; as conversion software.&lt;br /&gt;
&lt;br /&gt;
The implementation writes BIDS version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.10.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The participant table initially contains the BIDS participant identifier.&lt;br /&gt;
&lt;br /&gt;
Study-specific clinical information is not automatically inferred from BCI2000 recordings.&lt;br /&gt;
&lt;br /&gt;
==BCI2000 State Profiles==&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
&lt;br /&gt;
BCI2000 applications may define many study-specific states. Their names alone are not sufficient to determine their scientific meaning.&lt;br /&gt;
&lt;br /&gt;
For this reason, the converter uses a &#039;&#039;&#039;state-routing profile&#039;&#039;&#039; to determine how states should be represented in BIDS.&lt;br /&gt;
&lt;br /&gt;
Profiles may be written in:&lt;br /&gt;
&lt;br /&gt;
* JSON.&lt;br /&gt;
* YAML.&lt;br /&gt;
&lt;br /&gt;
A state may be assigned to:&lt;br /&gt;
&lt;br /&gt;
* An event.&lt;br /&gt;
* An additional event column.&lt;br /&gt;
* A continuous motion channel.&lt;br /&gt;
* The ignore list.&lt;br /&gt;
&lt;br /&gt;
A state should not be assigned to multiple routing categories.&lt;br /&gt;
&lt;br /&gt;
===Example Profile===&lt;br /&gt;
&lt;br /&gt;
A simple profile may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: generic-motion&lt;br /&gt;
&lt;br /&gt;
metadata:&lt;br /&gt;
  tracking_system: unknown&lt;br /&gt;
&lt;br /&gt;
events:&lt;br /&gt;
  Marker:&lt;br /&gt;
    strategy: rising_edge&lt;br /&gt;
    trial_type: marker&lt;br /&gt;
&lt;br /&gt;
motion:&lt;br /&gt;
  PositionX:&lt;br /&gt;
    column: position_x&lt;br /&gt;
    type: POSITION&lt;br /&gt;
    units: arbitrary&lt;br /&gt;
&lt;br /&gt;
ignore:&lt;br /&gt;
  - SourceTime&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Marker&amp;lt;/code&amp;gt; creates BIDS event rows.&lt;br /&gt;
* &amp;lt;code&amp;gt;PositionX&amp;lt;/code&amp;gt; becomes a continuous BIDS motion channel.&lt;br /&gt;
* &amp;lt;code&amp;gt;SourceTime&amp;lt;/code&amp;gt; is deliberately ignored.&lt;br /&gt;
&lt;br /&gt;
===Profile Validation===&lt;br /&gt;
&lt;br /&gt;
Profiles are checked before conversion.&lt;br /&gt;
&lt;br /&gt;
Invalid profiles include cases such as:&lt;br /&gt;
&lt;br /&gt;
* Invalid JSON or YAML.&lt;br /&gt;
* Unsupported event strategies.&lt;br /&gt;
* Duplicate state routing.&lt;br /&gt;
* Invalid event-column definitions.&lt;br /&gt;
* Duplicate event-column names.&lt;br /&gt;
* Reserved event-column names.&lt;br /&gt;
* Invalid motion definitions.&lt;br /&gt;
* Invalid metadata structures.&lt;br /&gt;
&lt;br /&gt;
The standard BIDS event fields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
onset&lt;br /&gt;
duration&lt;br /&gt;
trial_type&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
are reserved and cannot be redefined as custom event columns.&lt;br /&gt;
&lt;br /&gt;
==Automatic Profile Generation==&lt;br /&gt;
&lt;br /&gt;
If a profile is not supplied, the converter may inspect the first recording and create a starter profile.&lt;br /&gt;
&lt;br /&gt;
The automatic profile generator examines properties such as:&lt;br /&gt;
&lt;br /&gt;
* State name.&lt;br /&gt;
* State bit width.&lt;br /&gt;
* Minimum value.&lt;br /&gt;
* Maximum value.&lt;br /&gt;
* Number of unique values.&lt;br /&gt;
* Number of transitions.&lt;br /&gt;
* Transition fraction.&lt;br /&gt;
* Number of nonzero samples.&lt;br /&gt;
* Percentage of nonzero samples.&lt;br /&gt;
&lt;br /&gt;
States with names suggesting continuously varying signals such as joystick, cursor, gaze, position, or similar values may be proposed as motion channels.&lt;br /&gt;
&lt;br /&gt;
Low-cardinality or event-like states may be proposed as events.&lt;br /&gt;
&lt;br /&gt;
Internal-looking states such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SourceTime&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Recording&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
may be proposed for exclusion.&lt;br /&gt;
&lt;br /&gt;
Automatically generated profiles contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;review_required&amp;quot;: true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and are saved inside the BIDS dataset under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
code/bci2000-bids/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Automatically generated profiles are suggestions and should be reviewed before scientific use.&#039;&#039;&#039; The converter cannot determine the experimental meaning of a state from its name or numeric behavior alone.&lt;br /&gt;
&lt;br /&gt;
==Event Conversion==&lt;br /&gt;
&lt;br /&gt;
BCI2000 states may be converted into BIDS &amp;lt;code&amp;gt;*_events.tsv&amp;lt;/code&amp;gt; rows.&lt;br /&gt;
&lt;br /&gt;
The base event table contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
onset    duration    trial_type&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Onsets and durations are expressed in seconds.&lt;br /&gt;
&lt;br /&gt;
===Event Strategies===&lt;br /&gt;
&lt;br /&gt;
The following event strategies are supported:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Strategy&lt;br /&gt;
! Behavior&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rising_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event when the state changes from zero to nonzero.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;falling_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event when the state changes from nonzero to zero.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;change&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event whenever the state value changes.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;value_change&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event whenever the state value changes.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nonzero_change&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates an event when a transition results in a nonzero value.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;interval&amp;lt;/code&amp;gt;&lt;br /&gt;
| Treats each continuous nonzero period as an event interval.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Edge and value-change events have zero duration.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;interval&amp;lt;/code&amp;gt;, the duration corresponds to the length of the contiguous nonzero period.&lt;br /&gt;
&lt;br /&gt;
===Additional Event Columns===&lt;br /&gt;
&lt;br /&gt;
Other BCI2000 states may be mapped as additional columns associated with generated events.&lt;br /&gt;
&lt;br /&gt;
For example, a task may use one state to trigger an event while states such as condition, target, block, response type, or trial number are sampled at that event and placed into additional TSV columns.&lt;br /&gt;
&lt;br /&gt;
Additional nonstandard columns are described in the corresponding &amp;lt;code&amp;gt;*_events.json&amp;lt;/code&amp;gt; sidecar.&lt;br /&gt;
&lt;br /&gt;
An additional event-column mapping by itself does not create an event. An event rule must first define when event rows are generated.&lt;br /&gt;
&lt;br /&gt;
==Motion and Continuous State Conversion==&lt;br /&gt;
&lt;br /&gt;
Continuously varying BCI2000 states may be written to the BIDS &amp;lt;code&amp;gt;motion/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Examples may include states representing:&lt;br /&gt;
&lt;br /&gt;
* Joystick position.&lt;br /&gt;
* Cursor position.&lt;br /&gt;
* Eye position.&lt;br /&gt;
* Gaze position.&lt;br /&gt;
* Limb position.&lt;br /&gt;
* Other continuous task or kinematic variables.&lt;br /&gt;
&lt;br /&gt;
The converter does not determine these meanings automatically during normal conversion. The user specifies them through the state-routing profile.&lt;br /&gt;
&lt;br /&gt;
A typical motion output consists of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.tsv&lt;br /&gt;
sub-001_ses-01_task-motor_run-01_tracksys-unknown_motion.json&lt;br /&gt;
sub-001_ses-01_task-motor_run-01_tracksys-unknown_channels.tsv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The motion TSV is headerless.&lt;br /&gt;
&lt;br /&gt;
Column information is stored in the motion channels TSV:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name    type    units    description&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A motion mapping may define:&lt;br /&gt;
&lt;br /&gt;
* Column name.&lt;br /&gt;
* Motion type.&lt;br /&gt;
* Units.&lt;br /&gt;
* Description.&lt;br /&gt;
&lt;br /&gt;
The associated JSON sidecar records information such as:&lt;br /&gt;
&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Start time.&lt;br /&gt;
* Column order.&lt;br /&gt;
* Tracking-system name.&lt;br /&gt;
&lt;br /&gt;
All motion states in one output file must contain the same number of samples.&lt;br /&gt;
&lt;br /&gt;
==Neural Signal Conversion==&lt;br /&gt;
&lt;br /&gt;
When neural export is enabled, BCI2000 signal channels are exported as EDF.&lt;br /&gt;
&lt;br /&gt;
The converter currently supports:&lt;br /&gt;
&lt;br /&gt;
* EEG EDF output.&lt;br /&gt;
* iEEG EDF output.&lt;br /&gt;
&lt;br /&gt;
The BCI2000 signal matrix is read with calibration gains applied and converted into the orientation required by the output writer.&lt;br /&gt;
&lt;br /&gt;
A corresponding BIDS channel table contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name    type    units&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For EEG, channels normally use the BIDS channel type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EEG&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For iEEG, the channel type is selected from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ECOG&lt;br /&gt;
SEEG&lt;br /&gt;
DBS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The electrophysiology JSON sidecar includes information such as:&lt;br /&gt;
&lt;br /&gt;
* Task name.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Recording duration.&lt;br /&gt;
* Reference.&lt;br /&gt;
* Source system.&lt;br /&gt;
* Conversion software.&lt;br /&gt;
&lt;br /&gt;
The source system is identified as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BCI2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The conversion software is identified as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
&lt;br /&gt;
Python &#039;&#039;&#039;3.10 or newer&#039;&#039;&#039; is required.&lt;br /&gt;
&lt;br /&gt;
The primary Python dependencies are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;numpy&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;pyEDFlib&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PyYAML&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;BCI2000Tools&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tkinter is required for the graphical interface.&lt;br /&gt;
&lt;br /&gt;
===Recommended Installation===&lt;br /&gt;
&lt;br /&gt;
From a local checkout of the repository, create a Python virtual environment.&lt;br /&gt;
&lt;br /&gt;
On macOS or Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python3 -m venv .venv&lt;br /&gt;
source .venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
python -m pip install --upgrade pip&lt;br /&gt;
python -m pip install -r requirements.txt&lt;br /&gt;
python -m pip install -e .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows PowerShell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
py -3.14 -m venv .venv&lt;br /&gt;
.venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
python -m pip install --upgrade pip&lt;br /&gt;
python -m pip install -r requirements.txt&lt;br /&gt;
python -m pip install -e .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package also defines installation extras for BCI2000 and YAML support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m pip install -e &amp;quot;.[yaml,bci2000]&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For development:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m pip install -e &amp;quot;.[yaml,bci2000,dev]&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu systems, Tkinter may need to be installed separately:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install python3-tk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The external BIDS Validator is not installed automatically with the Python package.&lt;br /&gt;
&lt;br /&gt;
==Graphical Interface==&lt;br /&gt;
&lt;br /&gt;
The graphical interface may be launched with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids-gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m bci2000_bids.gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may also be launched from the main command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GUI supports:&lt;br /&gt;
&lt;br /&gt;
* Selecting one or more &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* Selecting an input directory.&lt;br /&gt;
* Recursive input discovery.&lt;br /&gt;
* Selecting a BIDS output directory.&lt;br /&gt;
* Subject label entry.&lt;br /&gt;
* Session label entry.&lt;br /&gt;
* Task label entry.&lt;br /&gt;
* Behavioral, EEG, or iEEG datatype selection.&lt;br /&gt;
* ECoG, SEEG, or DBS iEEG channel-type selection.&lt;br /&gt;
* Enabling or disabling neural export.&lt;br /&gt;
* Loading an existing profile.&lt;br /&gt;
* Creating a profile using an interactive state-routing editor.&lt;br /&gt;
* Automatic starter-profile generation.&lt;br /&gt;
* Source preservation.&lt;br /&gt;
* SHA-256 checksum generation.&lt;br /&gt;
* Existing-output policy selection.&lt;br /&gt;
* Recording inspection.&lt;br /&gt;
* Dry runs.&lt;br /&gt;
* Conversion.&lt;br /&gt;
* Optional BIDS validation.&lt;br /&gt;
* Progress and status reporting.&lt;br /&gt;
&lt;br /&gt;
The default GUI configuration uses:&lt;br /&gt;
&lt;br /&gt;
* Session &amp;lt;code&amp;gt;01&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Datatype &amp;lt;code&amp;gt;beh&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Neural export disabled.&lt;br /&gt;
* BIDS validation enabled.&lt;br /&gt;
* Existing-output policy &amp;lt;code&amp;gt;error&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Interface==&lt;br /&gt;
&lt;br /&gt;
The command-line program is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equivalent module invocation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m bci2000_bids&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The primary commands are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
inspect&lt;br /&gt;
convert&lt;br /&gt;
profile&lt;br /&gt;
validate&lt;br /&gt;
gui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inspect===&lt;br /&gt;
&lt;br /&gt;
To inspect one BCI2000 recording without converting it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids inspect recording.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inspection reports information including:&lt;br /&gt;
&lt;br /&gt;
* File name.&lt;br /&gt;
* Resolved path.&lt;br /&gt;
* Recording duration.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Number of channels.&lt;br /&gt;
* Number of samples.&lt;br /&gt;
* Channel names.&lt;br /&gt;
* State names.&lt;br /&gt;
* State bit widths.&lt;br /&gt;
* Selected BCI2000 parameters.&lt;br /&gt;
&lt;br /&gt;
Selected parameters include:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SamplingRate&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DataFormat&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Application&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SignalSource&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ChannelNames&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SourceChUnits&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generate a Profile===&lt;br /&gt;
&lt;br /&gt;
A starter state-routing profile may be generated with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids profile recording.dat --output profile.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; is omitted, the generated JSON profile is printed to standard output.&lt;br /&gt;
&lt;br /&gt;
The profile should be reviewed before conversion.&lt;br /&gt;
&lt;br /&gt;
===Basic Conversion===&lt;br /&gt;
&lt;br /&gt;
A basic iEEG conversion is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Behavioral/State-Only Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert states without neural data:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype beh \&lt;br /&gt;
  --no-neural \&lt;br /&gt;
  --profile profile.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Directory Conversion===&lt;br /&gt;
&lt;br /&gt;
To recursively discover BCI2000 files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert incoming/ \&lt;br /&gt;
  --output bids/ \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype eeg \&lt;br /&gt;
  --recursive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Source Preservation===&lt;br /&gt;
&lt;br /&gt;
To retain the original BCI2000 recordings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --profile profile.json \&lt;br /&gt;
  --preserve-source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Validation During Conversion===&lt;br /&gt;
&lt;br /&gt;
To run BIDS validation before publishing the converted dataset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --validate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dry Run===&lt;br /&gt;
&lt;br /&gt;
A conversion may be checked without publishing the final dataset using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--dry-run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dry run performs discovery, profile/configuration resolution, run assignment, and destination checking without publishing the final converted dataset.&lt;br /&gt;
&lt;br /&gt;
===Debug Logging===&lt;br /&gt;
&lt;br /&gt;
The global debugging option is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids --debug ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--debug&amp;lt;/code&amp;gt; must appear before the subcommand.&lt;br /&gt;
&lt;br /&gt;
==Typical Workflow==&lt;br /&gt;
&lt;br /&gt;
A typical command-line workflow is:&lt;br /&gt;
&lt;br /&gt;
===1. Inspect the recording===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids inspect recording.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===2. Generate a starter profile===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids profile recording.dat --output profile.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. Review the profile===&lt;br /&gt;
&lt;br /&gt;
Inspect the generated state mappings and confirm that each BCI2000 state has been assigned to the correct scientific role.&lt;br /&gt;
&lt;br /&gt;
In particular, confirm which states represent:&lt;br /&gt;
&lt;br /&gt;
* Experimental events.&lt;br /&gt;
* Event metadata.&lt;br /&gt;
* Continuous behavioral or motion signals.&lt;br /&gt;
* States that should be ignored.&lt;br /&gt;
&lt;br /&gt;
===4. Perform a dry run===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --profile profile.json \&lt;br /&gt;
  --dry-run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===5. Convert===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --subject 001 \&lt;br /&gt;
  --session 01 \&lt;br /&gt;
  --task motor \&lt;br /&gt;
  --datatype ieeg \&lt;br /&gt;
  --channel-type ECOG \&lt;br /&gt;
  --profile profile.json \&lt;br /&gt;
  --preserve-source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===6. Validate===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids validate bids/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Files==&lt;br /&gt;
&lt;br /&gt;
In addition to state-routing profiles, general conversion settings may be stored in JSON or YAML configuration files.&lt;br /&gt;
&lt;br /&gt;
A configuration may contain fields such as:&lt;br /&gt;
&lt;br /&gt;
* Subject.&lt;br /&gt;
* Session.&lt;br /&gt;
* Task.&lt;br /&gt;
* Datatype.&lt;br /&gt;
* Neural export.&lt;br /&gt;
* iEEG channel type.&lt;br /&gt;
* Source preservation.&lt;br /&gt;
* Existing-output behavior.&lt;br /&gt;
* Profile path.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
subject: &amp;quot;001&amp;quot;&lt;br /&gt;
session: &amp;quot;01&amp;quot;&lt;br /&gt;
task: &amp;quot;motor&amp;quot;&lt;br /&gt;
datatype: &amp;quot;beh&amp;quot;&lt;br /&gt;
preserve_source: true&lt;br /&gt;
profile: &amp;quot;generic-motion.yaml&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A configuration may be supplied with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids convert recording.dat \&lt;br /&gt;
  --output bids \&lt;br /&gt;
  --config examples/configs/study.yaml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Command-line configuration handling is still under development. Explicit &amp;lt;code&amp;gt;--subject&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--task&amp;lt;/code&amp;gt; arguments should currently be supplied for reliable noninteractive CLI use.&lt;br /&gt;
&lt;br /&gt;
==Existing Output Handling==&lt;br /&gt;
&lt;br /&gt;
The converter protects existing BIDS data by default.&lt;br /&gt;
&lt;br /&gt;
The existing-output policy may be selected using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--on-existing&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Supported values are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Behavior&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;error&amp;lt;/code&amp;gt;&lt;br /&gt;
| Default. Stop if the target subject/session already exists.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;skip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Leave the existing subject/session unchanged and skip conversion.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;overwrite&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rebuild the requested subject/session while retaining other dataset content.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default policy is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Data Preservation==&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--preserve-source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is enabled, the original BCI2000 recording is copied to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourcedata/sub-&amp;lt;subject&amp;gt;/ses-&amp;lt;session&amp;gt;/bci2000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourcedata/sub-001/ses-01/bci2000/recording.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A SHA-256 checksum manifest is written as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourcedata/sub-001/ses-01/bci2000/checksums.tsv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with columns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
filename    sha256&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The preserved BCI2000 files are copies of the original recordings and are &#039;&#039;&#039;not anonymized by the converter&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Users should therefore review BCI2000 parameters and other source metadata before distributing &amp;lt;code&amp;gt;sourcedata/&amp;lt;/code&amp;gt; outside the research environment.&lt;br /&gt;
&lt;br /&gt;
==Data Safety==&lt;br /&gt;
&lt;br /&gt;
Conversions are built in a temporary staging directory rather than directly modifying the published BIDS dataset.&lt;br /&gt;
&lt;br /&gt;
When updating an existing dataset:&lt;br /&gt;
&lt;br /&gt;
# The current dataset is copied into a staging location.&lt;br /&gt;
# New conversion output is created in staging.&lt;br /&gt;
# Validation may be performed against the staged dataset.&lt;br /&gt;
# The original dataset is retained until processing succeeds.&lt;br /&gt;
# The staged dataset is moved into place after successful conversion.&lt;br /&gt;
&lt;br /&gt;
When replacement of an existing output root is necessary, the current output is temporarily renamed to a backup location before publication of the staged dataset.&lt;br /&gt;
&lt;br /&gt;
If publication fails, the converter attempts to restore the previous dataset.&lt;br /&gt;
&lt;br /&gt;
EDF files are also created through temporary output before final replacement.&lt;br /&gt;
&lt;br /&gt;
Additional input checks include rejection of:&lt;br /&gt;
&lt;br /&gt;
* Duplicate input basenames.&lt;br /&gt;
* Invalid subject labels.&lt;br /&gt;
* Invalid session labels.&lt;br /&gt;
* Invalid task labels.&lt;br /&gt;
* Invalid tracking-system names.&lt;br /&gt;
* Invalid iEEG channel types.&lt;br /&gt;
* Missing states required by a profile.&lt;br /&gt;
* Invalid signal dimensions.&lt;br /&gt;
* Duplicate or invalid EDF channel labels.&lt;br /&gt;
* Nonfinite neural samples.&lt;br /&gt;
* Certain EDF-incompatible signal conditions.&lt;br /&gt;
&lt;br /&gt;
==BIDS Validation==&lt;br /&gt;
&lt;br /&gt;
The converter includes an optional validation step.&lt;br /&gt;
&lt;br /&gt;
To validate an existing converted dataset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bci2000-bids validate bids/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converter first performs basic internal checks, including confirming that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dataset_description.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
exists and contains valid JSON.&lt;br /&gt;
&lt;br /&gt;
When available, it then invokes the external BIDS Validator.&lt;br /&gt;
&lt;br /&gt;
The [https://bids-standard.github.io/bids-validator/ official BIDS Validator] may also be used independently.&lt;br /&gt;
&lt;br /&gt;
When validation is enabled during conversion, validation occurs against the staged dataset before it is published. A validation failure therefore prevents the invalid staged conversion from replacing the existing output dataset.&lt;br /&gt;
&lt;br /&gt;
The external validator must currently be installed separately.&lt;br /&gt;
&lt;br /&gt;
==Clinical and Participant Metadata==&lt;br /&gt;
&lt;br /&gt;
The converter currently handles operational BIDS identifiers and recording metadata such as:&lt;br /&gt;
&lt;br /&gt;
* Participant identifier.&lt;br /&gt;
* Session identifier.&lt;br /&gt;
* Task.&lt;br /&gt;
* Datatype.&lt;br /&gt;
* Run number.&lt;br /&gt;
* Sampling frequency.&lt;br /&gt;
* Recording duration.&lt;br /&gt;
* Channel names.&lt;br /&gt;
* Channel units.&lt;br /&gt;
* Neural channel type.&lt;br /&gt;
* Reference information.&lt;br /&gt;
* Motion tracking-system name.&lt;br /&gt;
&lt;br /&gt;
The converter does &#039;&#039;&#039;not&#039;&#039;&#039; currently automatically extract or request study-specific clinical metadata such as:&lt;br /&gt;
&lt;br /&gt;
* Diagnosis.&lt;br /&gt;
* Age.&lt;br /&gt;
* Sex.&lt;br /&gt;
* Handedness.&lt;br /&gt;
* Surgical procedure.&lt;br /&gt;
* Medication state.&lt;br /&gt;
* DBS stimulation state.&lt;br /&gt;
* Implant target.&lt;br /&gt;
* Recording location.&lt;br /&gt;
* Participant name.&lt;br /&gt;
* Medical record number.&lt;br /&gt;
* Date of birth.&lt;br /&gt;
&lt;br /&gt;
Such metadata must be handled separately when required by a study.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
&lt;br /&gt;
The current version is focused specifically on converting BCI2000 recordings and synchronized states into electrophysiology, behavioral, event, and motion components of BIDS.&lt;br /&gt;
&lt;br /&gt;
The following are not currently supported:&lt;br /&gt;
&lt;br /&gt;
* Imaging conversion.&lt;br /&gt;
* Video conversion.&lt;br /&gt;
* NeuroOmega file conversion.&lt;br /&gt;
* Automatic ingestion of BCI2000 companion files.&lt;br /&gt;
* Modalities other than &amp;lt;code&amp;gt;beh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;eeg&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ieeg&amp;lt;/code&amp;gt;.&lt;br /&gt;
* BrainVision output.&lt;br /&gt;
* FIF output.&lt;br /&gt;
* NIfTI output.&lt;br /&gt;
* Automatic grouping of recordings using BCI2000 recording metadata.&lt;br /&gt;
* Comprehensive export of every BCI2000 parameter into BIDS metadata.&lt;br /&gt;
* Automatic extraction of clinical or surgical metadata.&lt;br /&gt;
* Automatic anonymization of preserved BCI2000 source files.&lt;br /&gt;
* Automatic generation of &amp;lt;code&amp;gt;.bidsignore&amp;lt;/code&amp;gt;.&lt;br /&gt;
* General provenance manifests beyond source checksums and generated conversion profiles.&lt;br /&gt;
&lt;br /&gt;
Automatic state classification is heuristic and should not be treated as a substitute for knowledge of the experiment.&lt;br /&gt;
&lt;br /&gt;
==Development and Testing==&lt;br /&gt;
&lt;br /&gt;
The project contains unit and integration tests for core conversion functionality.&lt;br /&gt;
&lt;br /&gt;
Current automated testing covers areas including:&lt;br /&gt;
&lt;br /&gt;
* BIDS dataset initialization.&lt;br /&gt;
* Dataset descriptions.&lt;br /&gt;
* Participant-table creation.&lt;br /&gt;
* BIDS label normalization.&lt;br /&gt;
* BIDS run naming.&lt;br /&gt;
* Rising-edge event generation.&lt;br /&gt;
* Interval event generation.&lt;br /&gt;
* State-change event generation.&lt;br /&gt;
* Motion TSV output.&lt;br /&gt;
* Motion channel definitions.&lt;br /&gt;
* Duplicate state-routing rejection.&lt;br /&gt;
* BCI2000 parameter parsing utilities.&lt;br /&gt;
* Deterministic input discovery.&lt;br /&gt;
* Recursive input discovery.&lt;br /&gt;
* Synthetic state/event conversion.&lt;br /&gt;
* Synthetic iEEG EDF conversion.&lt;br /&gt;
* EDF read-back using pyEDFlib.&lt;br /&gt;
* Missing-unit fallback behavior.&lt;br /&gt;
&lt;br /&gt;
The current integration tests use synthetic/mock BCI2000 recordings rather than decoding real clinical or experimental BCI2000 files.&lt;br /&gt;
&lt;br /&gt;
Real BCI2000 files should therefore be tested and reviewed in the intended research environment before relying on a new conversion workflow for production datasets.&lt;br /&gt;
&lt;br /&gt;
==BIDS Background==&lt;br /&gt;
&lt;br /&gt;
[https://bids.neuroimaging.io/ BIDS] is a community-developed standard for organizing neural and associated experimental data in a consistent filesystem structure.&lt;br /&gt;
&lt;br /&gt;
A typical BIDS hierarchy follows the general form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dataset/&lt;br /&gt;
└── sub-&amp;lt;subject&amp;gt;/&lt;br /&gt;
    └── ses-&amp;lt;session&amp;gt;/&lt;br /&gt;
        └── &amp;lt;datatype&amp;gt;/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within this structure, file names encode entities such as subject, session, task, and run.&lt;br /&gt;
&lt;br /&gt;
The BCI2000 to BIDS Converter performs this transformation automatically for supported BCI2000 data while retaining synchronization between neural signals and selected BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
For the complete standard, see the [https://bids-specification.readthedocs.io/en/stable/ BIDS Specification].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# Gorgolewski KJ, Auer T, Calhoun VD, et al. [https://doi.org/10.1038/sdata.2016.44 The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments]. &#039;&#039;Scientific Data&#039;&#039;. 2016;3:160044. doi:10.1038/sdata.2016.44.&lt;br /&gt;
# [https://bids.neuroimaging.io/ Brain Imaging Data Structure (BIDS)].&lt;br /&gt;
# [https://bids-specification.readthedocs.io/en/stable/ BIDS Specification].&lt;br /&gt;
# [https://bids-standard.github.io/bids-validator/ BIDS Validator].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[User Reference:BCI2000Export|BCI2000Export]]&lt;br /&gt;
* [[User Reference:Command Line Processing|BCI2000 Command Line Processing]]&lt;br /&gt;
* [[BCI2000Tools.EventRelated|BCI2000Tools and Python Data Analysis]]&lt;br /&gt;
* [[User Tutorial:Data Analysis|BCI2000 Data Analysis Tutorials]]&lt;br /&gt;
* [https://bids.neuroimaging.io/ Brain Imaging Data Structure]&lt;br /&gt;
* [https://bids-specification.readthedocs.io/en/stable/ BIDS Specification]&lt;br /&gt;
* [https://bids-standard.github.io/bids-validator/ BIDS Validator]&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Analysis Tools]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12600</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12600"/>
		<updated>2026-09-22T19:54:52Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
Upon the completion of an SVN update, the source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from (prog folder):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;br /&gt;
&lt;br /&gt;
* [[Category:User Application]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12599</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12599"/>
		<updated>2026-09-22T19:54:14Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each experimental trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task also includes an optional participant introduction and practice sequence. Before the experiment begins, participants may receive task instructions, explore both normal and reversed cursor mappings, and complete automatic and controlled practice trials. Tutorial and practice periods are recorded in the BCI2000 data stream but remain separate from experimental trial numbering and experimental performance summaries.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&lt;br /&gt;
The following video demonstrates the Visuomotor Joystick Task running in BCI2000, including the participant display and joystick-controlled task behavior: &amp;lt;youtube alignment=&amp;quot;center&amp;quot;&amp;gt;https://www.youtube.com/watch?v=LSZW3nxg3Vg&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This video displays version 1 of the task, and as such does not include the pre-experiment participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* An optional participant tutorial and practice sequence.&lt;br /&gt;
* Automatic and controlled practice trials.&lt;br /&gt;
* Free-movement demonstrations of normal and reversed cursor control.&lt;br /&gt;
* Joystick-button and experimenter-controlled tutorial progression.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, tutorial status, practice trials, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information, tutorial controls, and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
* Separation of tutorial/practice data from experimental trial numbering, experimental CSV output, and run-summary metrics.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default experimental center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates experimental targets over a continuous range of angles rather than restricting targets to eight positions. It also provides an optional tutorial and practice sequence and records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
When the tutorial is enabled, its content depends on &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Experiment mode&lt;br /&gt;
! Tutorial content&lt;br /&gt;
|-&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| General introduction, normal free movement, automatic instructions, automatic practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| General introduction, normal free movement, controlled instructions, controlled free movement, controlled practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Ordered&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|-&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When both conditions are present, the tutorial always presents automatic training before controlled training. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; affects the experimental block order but does not change the tutorial order.&lt;br /&gt;
&lt;br /&gt;
===Tutorial and Practice Sequence===&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, the tutorial begins at the start of each run before the first experimental block.&lt;br /&gt;
&lt;br /&gt;
The tutorial consists of the following stages:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! TutorialPhase&lt;br /&gt;
! Stage&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| None&lt;br /&gt;
| Tutorial inactive; normal experiment operation&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Introduction&lt;br /&gt;
| General explanation of the task and upcoming conditions&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Normal free movement&lt;br /&gt;
| Participant explores normal direct joystick-to-cursor movement&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Automatic instructions&lt;br /&gt;
| Explanation of the automatic condition and green targets&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Automatic practice&lt;br /&gt;
| Automatic practice trials using the normal mapping&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Controlled instructions&lt;br /&gt;
| Explanation of the controlled condition and red targets&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Controlled free movement&lt;br /&gt;
| Participant explores continuous reversed joystick-to-cursor control&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Controlled practice&lt;br /&gt;
| Controlled practice trials using the inverted mapping&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Complete&lt;br /&gt;
| Practice-complete summary before the experiment begins&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=0&amp;lt;/code&amp;gt;, the tutorial is skipped and the task begins with the original experimental block-announcement sequence.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Continuation===&lt;br /&gt;
&lt;br /&gt;
Tutorial screens that require participant acknowledgement may be advanced using either:&lt;br /&gt;
&lt;br /&gt;
* Joystick button 1, or&lt;br /&gt;
* The experimenter&#039;s &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
Joystick continuation uses rising-edge detection. Pressing the button advances one eligible tutorial screen, while holding the button does not repeatedly advance the tutorial. The button must be released and pressed again to produce another continuation event.&lt;br /&gt;
&lt;br /&gt;
Button presses are ignored during active practice trials and during tutorial transitions that require the participant to return the joystick or cursor to center.&lt;br /&gt;
&lt;br /&gt;
During the experimental portion of the run, joystick button presses do not control trial progression.&lt;br /&gt;
&lt;br /&gt;
===Normal Free Movement===&lt;br /&gt;
&lt;br /&gt;
During the normal free-movement stage, the participant may freely move the cursor using the direct absolute joystick mapping.&lt;br /&gt;
&lt;br /&gt;
There is no timer or trial progression during this stage. It continues until the participant presses the joystick button or the experimenter selects &#039;&#039;&#039;CONTINUE&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Automatic Practice===&lt;br /&gt;
&lt;br /&gt;
Automatic practice uses the same direct mapping and the same basic trial phases as experimental automatic trials:&lt;br /&gt;
&lt;br /&gt;
# Waiting for center&lt;br /&gt;
# Holding center&lt;br /&gt;
# Warning&lt;br /&gt;
# Pre-target delay&lt;br /&gt;
# Target visible&lt;br /&gt;
# Feedback&lt;br /&gt;
&lt;br /&gt;
Practice trials differ from experimental trials in several ways:&lt;br /&gt;
&lt;br /&gt;
* Center hold is determined by &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Practice targets follow a deterministic sequence.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; remain 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; identifies the active practice trial.&lt;br /&gt;
* No trial row is written to the secondary CSV file.&lt;br /&gt;
* Practice results are excluded from experimental completion counts and timing summaries.&lt;br /&gt;
* Practice reset attempts do not increment experimental reset metrics.&lt;br /&gt;
&lt;br /&gt;
After the final automatic practice trial, the participant must return the cursor to the center before the tutorial advances.&lt;br /&gt;
&lt;br /&gt;
===Controlled Free Movement===&lt;br /&gt;
&lt;br /&gt;
The controlled free-movement stage allows the participant to explore reversed cursor control without a target.&lt;br /&gt;
&lt;br /&gt;
The participant is first asked to return the cursor to center. Once centered, the application records the current joystick and cursor positions as anchors and enables the same relative inverted mapping used during target-directed controlled movement.&lt;br /&gt;
&lt;br /&gt;
When the participant requests continuation, the task requires the joystick to return to the anchored position before advancing. This prevents an abrupt cursor jump when the mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Controlled Practice===&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses the same basic controlled-trial behavior as the experiment:&lt;br /&gt;
&lt;br /&gt;
* Direct absolute mapping is used during centering.&lt;br /&gt;
* Joystick and cursor anchors are recorded when the target appears.&lt;br /&gt;
* Target-directed cursor movement uses the relative inverted mapping.&lt;br /&gt;
* The participant returns the joystick toward its anchor after target acquisition.&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; and deterministic practice targets and remains separate from experimental numbering, CSV output, and performance summaries.&lt;br /&gt;
&lt;br /&gt;
After the final controlled practice trial, the participant must complete the return-to-center and return-to-anchor transition before the completion screen appears.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Completion===&lt;br /&gt;
&lt;br /&gt;
The completion screen summarizes the condition mappings:&lt;br /&gt;
&lt;br /&gt;
* Automatic: cursor movement follows joystick movement.&lt;br /&gt;
* Controlled: cursor movement is opposite joystick movement.&lt;br /&gt;
* Green targets identify automatic trials.&lt;br /&gt;
* Red targets identify controlled trials.&lt;br /&gt;
&lt;br /&gt;
After continuation, the tutorial ends, &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; returns to 0, the originally generated first experimental target is restored, and the experiment begins with the normal 1.5-second block announcement.&lt;br /&gt;
&lt;br /&gt;
===Experimental Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each experimental block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new experimental trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is used during the tutorial as a participant continuation button. A rising button press may advance eligible tutorial screens. It does not advance active practice trials and has no effect on experimental trial progression.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Experimental Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows experimental targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Practice Target Generation===&lt;br /&gt;
&lt;br /&gt;
Practice trials use a deterministic six-angle sequence rather than the experimental random target generator:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sequence value&lt;br /&gt;
! Target angle&lt;br /&gt;
|-&lt;br /&gt;
| 150&lt;br /&gt;
| 15 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 450&lt;br /&gt;
| 45 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 750&lt;br /&gt;
| 75 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1050&lt;br /&gt;
| 105 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1350&lt;br /&gt;
| 135 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1650&lt;br /&gt;
| 165 degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Automatic practice begins with the 15-degree target and follows the sequence in order.&lt;br /&gt;
&lt;br /&gt;
Controlled practice begins with an offset of two positions, producing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
75°, 105°, 135°, 165°, 15°, 45°&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If more than six practice trials are configured, the sequence repeats.&lt;br /&gt;
&lt;br /&gt;
These targets are positioned in the lower half of the participant display to reduce overlap with tutorial text.&lt;br /&gt;
&lt;br /&gt;
The random target generated for the first experimental trial is saved before the tutorial begins and restored after practice finishes.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current trial phase is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement / no active practice trial&lt;br /&gt;
| During the experiment, the upcoming block type is being displayed. During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is also 0.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During active automatic or controlled practice trials, values 1 through 6 retain the same meanings as they do during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Because non-trial tutorial screens use &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;, analysts should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish tutorial screens from experimental block announcements.&lt;br /&gt;
&lt;br /&gt;
An experimental target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A practice target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 1&lt;br /&gt;
and PracticeTrial &amp;gt; 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; reflects the tutorial condition rather than the first experimental condition. It begins at 0 during the general introduction and normal free-movement stages, including in Controlled Only mode, and changes to 1 once the controlled portion of the tutorial begins.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; is forced to 0 and should not be interpreted as an experimental ordered-automatic block.&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display during the experiment.&lt;br /&gt;
* Tutorial and practice instructions when the introduction is enabled.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all experimental trials are complete.&lt;br /&gt;
&lt;br /&gt;
The experimental progress bar is hidden throughout the tutorial and practice sequence. Practice trials do not contribute to experimental progress.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Tutorial mode.&lt;br /&gt;
* Numeric and textual tutorial phase.&lt;br /&gt;
* Tutorial condition.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
* Experimental trial as not yet started.&lt;br /&gt;
* Joystick coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state.&lt;br /&gt;
* Tutorial status.&lt;br /&gt;
&lt;br /&gt;
During the experiment, it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window contains a blue &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button for tutorial screens that require continuation.&lt;br /&gt;
&lt;br /&gt;
It also contains a reset button whose function changes according to task context:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RESET PRACTICE TRIAL&#039;&#039;&#039; during eligible practice trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET CURRENT TRIAL&#039;&#039;&#039; during eligible experimental trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET UNAVAILABLE&#039;&#039;&#039; when reset is not permitted.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
Experimental trials may be manually reset before they reach the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting an experimental trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the experimental diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
Practice trials may also be reset before feedback.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the practice trial to the waiting-for-center phase.&lt;br /&gt;
* Clears movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Keeps the same &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* Keeps the same deterministic target.&lt;br /&gt;
* Does not increment experimental reset metrics.&lt;br /&gt;
* Does not write a CSV row.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during tutorial instruction/free-movement screens and after a trial has entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for successfully completed practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
Practice timing values are recorded in the BCI2000 states but are excluded from experimental timing summaries and the secondary CSV output.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral and tutorial variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
Tutorial and practice samples are part of the same BCI2000 run as the experiment. The &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state should therefore be used when separating tutorial/practice data from experimental data during offline analysis.&lt;br /&gt;
&lt;br /&gt;
Practice trials record:&lt;br /&gt;
&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Target coordinates and angle.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Practice condition.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Practice reset events.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
&lt;br /&gt;
Practice trials are intentionally excluded from:&lt;br /&gt;
&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Secondary CSV rows.&lt;br /&gt;
* Automatic and controlled completion counts.&lt;br /&gt;
* Automatic and controlled reset counts.&lt;br /&gt;
* Mean reaction-time summaries.&lt;br /&gt;
* Mean movement-time summaries.&lt;br /&gt;
* Mean total-time summaries.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed experimental trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials and practice trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===EnableIntroduction===&lt;br /&gt;
&lt;br /&gt;
Enables or disables the participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
Type: integer boolean&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Skip the tutorial and begin the experiment normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Run the tutorial and practice sequence before the experiment.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to all experiment modes.&lt;br /&gt;
&lt;br /&gt;
===AutomaticPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains automatic trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips automatic practice trials while retaining the automatic instruction page.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===ControlledPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains controlled trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips controlled practice trials. The controlled instruction page and controlled free-movement demonstration are still presented.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===PracticeCenterHoldTime===&lt;br /&gt;
&lt;br /&gt;
Center-hold duration used during automatic and controlled practice trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating-point time&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0s-60s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This parameter replaces &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt; during practice trials only.&lt;br /&gt;
&lt;br /&gt;
Experimental trials continue to use &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
The selected mode also determines which condition-specific tutorial sections are presented when &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic experimental trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled experimental trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which experimental condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
It also does not affect tutorial order. When both conditions are included, the tutorial always presents automatic training before controlled training.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter does not control practice center-hold duration. Practice trials use &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial, tutorial transition, or experimental block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary experimental trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
Only successful experimental trials are written to this file. Practice trials are not written to the CSV.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether the participant tutorial/practice sequence is active.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive or disabled; experimental data&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Tutorial or practice sequence active&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, this state becomes 1 at the beginning of the run and returns to 0 when the tutorial completes and the experiment begins.&lt;br /&gt;
&lt;br /&gt;
This is the primary state for separating tutorial/practice samples from experimental samples during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TutorialPhase===&lt;br /&gt;
&lt;br /&gt;
4-bit state indicating the current stage of the tutorial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: General introduction&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Normal free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Automatic instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Automatic practice&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Controlled instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Controlled free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Controlled practice&lt;br /&gt;
* &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;: Practice complete&lt;br /&gt;
&lt;br /&gt;
After the final automatic or controlled practice feedback interval, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; may remain 4 or 7 while &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; has returned to 0 and the task waits for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Outside the tutorial, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
===PracticeTrial===&lt;br /&gt;
&lt;br /&gt;
8-bit state identifying the active practice trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: No active practice trial&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: One-based practice trial number within the current practice condition&lt;br /&gt;
&lt;br /&gt;
The state remains nonzero through the practice trial&#039;s feedback phase.&lt;br /&gt;
&lt;br /&gt;
After the final practice feedback interval it returns to 0 while the tutorial may still wait for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial does not increment &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current trial phase.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Experimental block announcement or non-trial tutorial screen&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
During active practice trials, values 1 through 6 have the same meanings as during experimental trials.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is forced to 0. Therefore, &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; alone no longer uniquely identifies an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
Use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0 and TaskPhase == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to identify an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
During active practice trials, this state identifies the practice condition.&lt;br /&gt;
&lt;br /&gt;
During the general introduction and normal free-movement tutorial stages, it initially reports 0 even when the configured experiment is Controlled Only.&lt;br /&gt;
&lt;br /&gt;
During the experiment it retains its original meaning.&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current experimental block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
During the tutorial, this state is forced to 0. It should therefore only be interpreted as an experimental block type when &amp;lt;code&amp;gt;Introduction=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During experimental trials, generated values range from &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During practice trials, the state contains the deterministic practice-target angle.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is set to 0.&lt;br /&gt;
&lt;br /&gt;
After tutorial completion, the saved first experimental target is restored.&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, target states are suppressed.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, target states are suppressed.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based experimental block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental block begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental block numbers.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall experimental trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental trial begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across experimental block boundaries. Manually resetting an experimental trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental trial numbers.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current active practice or experimental trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 identifies movement onset.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is forced to 0.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish practice movement onset from experimental movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches a practice or experimental target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
Experimental acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets a practice or experimental trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
Experimental reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. During the tutorial, a rising press may advance eligible instruction or free-movement screens. It does not advance active practice trials and does not control experimental progression.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
Because the tutorial and practice sequence are recorded within the same BCI2000 run as the experiment, analyses should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish experimental data from tutorial and practice data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! Recommended identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Tutorial/practice samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block announcement&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Non-trial tutorial screen&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, typically with &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;, interpreted together with &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
Analyses written for earlier versions of the task should be updated before use with tutorial-enabled data. In particular:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; no longer always identifies an experimental block announcement.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt; may indicate a practice or experimental success.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt; may indicate a practice or experimental reset.&lt;br /&gt;
* Nonzero timing states may belong to practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; should not be interpreted as experimental condition/block variables while &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;br /&gt;
* [[Category:User Application]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:Application&amp;diff=12598</id>
		<title>Contributions:Application</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:Application&amp;diff=12598"/>
		<updated>2026-09-22T19:52:27Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Application Modules from the &amp;quot;private&amp;quot; section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following user application components are available in the [[Contributions:Contents|Contributions]] section of BCI2000:&lt;br /&gt;
&lt;br /&gt;
==Application Modules==&lt;br /&gt;
*[[Contributions:MFCdemo]]: Demo application module written using the Microsoft MFC framework.&lt;br /&gt;
*[[Contributions:SlowWaveApp]]: Application modules for Slow Wave feedback.&lt;br /&gt;
&amp;lt;!--*[[Contributions:Speller]]: A speller application based on cursor feedback.--&amp;gt;&lt;br /&gt;
*[[Contributions:ANTTask]]: An attention task application.&lt;br /&gt;
*[[Contributions:ANTTitration]]: A titration application to calibrate the ANTTask.&lt;br /&gt;
*[[Contributions:CenterOutTask]]: An implementation of the classic Center-Out task.&lt;br /&gt;
*[[Contributions:EglyDriverTask]]: An implementation of the Egly-Driver task.&lt;br /&gt;
*[[Contributions:ERPSpeller]]: A speller application similar to the P3Speller.&lt;br /&gt;
*[[Contributions:ForagingTask]]: A foraging movement task.&lt;br /&gt;
*[[Contributions:WCSTTask]]: An implementation of the Wisconsin Card Sorting Test.&lt;br /&gt;
&lt;br /&gt;
==Application Modules and Filters from the &amp;quot;private&amp;quot; section==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Access to components from the &amp;quot;private&amp;quot; section requires signing a non-disclosure agreement. Please contact brunner[at]neurotechcenter.org for more information.&lt;br /&gt;
&lt;br /&gt;
*[[Contributions:gEstimFilter]]: Cortical stimulation with the gtec g.Estim PRO.&lt;br /&gt;
*[[VisuomotorJoystickTask]]: Center-out visuomotor reaching task using a USB HID joystick with normal and inverted cursor mappings.&lt;br /&gt;
*[[FEP_VisuomotorJoystickTask]]: Visuomotor joystick task with hidden mapping changes and cursor-gain manipulations for studying behavioral adaptation under changing sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
==Interoperability==&lt;br /&gt;
*[[Contributions:BCI2000Command]]: Remote control of BCI2000 from the command line.&lt;br /&gt;
&amp;lt;!--*[[Contributions:BCI2000Automation]]: Remote control of BCI2000 from Matlab, Scripting Engines, and .NET languages.--&amp;gt;&lt;br /&gt;
*[[Contributions:BCI2000PresentationLink]]: Using BCI2000 with the [http://www.neurobs.com/ NBS Presentation] stimulus delivery software.&lt;br /&gt;
*[[Contributions:BCI2000PythonBindings]]: Remote control of BCI2000 from Python scripts.&lt;br /&gt;
*[[Contributions:BCI2000SimulinkConnector]]: A component that exports BCI2000 data to a BCI2000 Simulink block.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User Application]][[Category:Contents]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:Application&amp;diff=12597</id>
		<title>Contributions:Application</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:Application&amp;diff=12597"/>
		<updated>2026-09-22T19:52:06Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Application Filters from the &amp;quot;private&amp;quot; section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following user application components are available in the [[Contributions:Contents|Contributions]] section of BCI2000:&lt;br /&gt;
&lt;br /&gt;
==Application Modules==&lt;br /&gt;
*[[Contributions:MFCdemo]]: Demo application module written using the Microsoft MFC framework.&lt;br /&gt;
*[[Contributions:SlowWaveApp]]: Application modules for Slow Wave feedback.&lt;br /&gt;
&amp;lt;!--*[[Contributions:Speller]]: A speller application based on cursor feedback.--&amp;gt;&lt;br /&gt;
*[[Contributions:ANTTask]]: An attention task application.&lt;br /&gt;
*[[Contributions:ANTTitration]]: A titration application to calibrate the ANTTask.&lt;br /&gt;
*[[Contributions:CenterOutTask]]: An implementation of the classic Center-Out task.&lt;br /&gt;
*[[Contributions:EglyDriverTask]]: An implementation of the Egly-Driver task.&lt;br /&gt;
*[[Contributions:ERPSpeller]]: A speller application similar to the P3Speller.&lt;br /&gt;
*[[Contributions:ForagingTask]]: A foraging movement task.&lt;br /&gt;
*[[Contributions:WCSTTask]]: An implementation of the Wisconsin Card Sorting Test.&lt;br /&gt;
&lt;br /&gt;
==Application Modules and Filters from the &amp;quot;private&amp;quot; section==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Access to components from the &amp;quot;private&amp;quot; section requires signing a non-disclosure agreement. Please contact brunner[at]neurotechcenter.org for more information.&lt;br /&gt;
&lt;br /&gt;
*[[Contributions:gEstimFilter]]: Cortical stimulation with the gtec g.Estim PRO.&lt;br /&gt;
*[[VisuomotorJoystickTask]]: Center-out visuomotor reaching task using a USB HID joystick with normal and inverted cursor mappings.&lt;br /&gt;
*[[FEP_VisuomotorJoystickTask]]: Visuomotor joystick task with hidden mapping changes and cursor-gain manipulations for studying behavioral adaptation under changing sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
==Application Modules from the &amp;quot;private&amp;quot; section==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Access to components from the &amp;quot;private&amp;quot; section requires signing a non-disclosure agreement. Please contact brunner[at]neurotechcenter.org for more information.&lt;br /&gt;
*[[VisuomotorJoystickTask]]: Center-out visuomotor reaching task using a USB HID joystick with normal and inverted cursor mappings.&lt;br /&gt;
*[[FEP_VisuomotorJoystickTask]]: Visuomotor joystick task with hidden mapping changes and cursor-gain manipulations for studying behavioral adaptation under changing sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
==Interoperability==&lt;br /&gt;
*[[Contributions:BCI2000Command]]: Remote control of BCI2000 from the command line.&lt;br /&gt;
&amp;lt;!--*[[Contributions:BCI2000Automation]]: Remote control of BCI2000 from Matlab, Scripting Engines, and .NET languages.--&amp;gt;&lt;br /&gt;
*[[Contributions:BCI2000PresentationLink]]: Using BCI2000 with the [http://www.neurobs.com/ NBS Presentation] stimulus delivery software.&lt;br /&gt;
*[[Contributions:BCI2000PythonBindings]]: Remote control of BCI2000 from Python scripts.&lt;br /&gt;
*[[Contributions:BCI2000SimulinkConnector]]: A component that exports BCI2000 data to a BCI2000 Simulink block.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User Application]][[Category:Contents]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:Application&amp;diff=12596</id>
		<title>Contributions:Application</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:Application&amp;diff=12596"/>
		<updated>2026-09-22T19:49:58Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Application Filters from the &amp;quot;private&amp;quot; section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following user application components are available in the [[Contributions:Contents|Contributions]] section of BCI2000:&lt;br /&gt;
&lt;br /&gt;
==Application Modules==&lt;br /&gt;
*[[Contributions:MFCdemo]]: Demo application module written using the Microsoft MFC framework.&lt;br /&gt;
*[[Contributions:SlowWaveApp]]: Application modules for Slow Wave feedback.&lt;br /&gt;
&amp;lt;!--*[[Contributions:Speller]]: A speller application based on cursor feedback.--&amp;gt;&lt;br /&gt;
*[[Contributions:ANTTask]]: An attention task application.&lt;br /&gt;
*[[Contributions:ANTTitration]]: A titration application to calibrate the ANTTask.&lt;br /&gt;
*[[Contributions:CenterOutTask]]: An implementation of the classic Center-Out task.&lt;br /&gt;
*[[Contributions:EglyDriverTask]]: An implementation of the Egly-Driver task.&lt;br /&gt;
*[[Contributions:ERPSpeller]]: A speller application similar to the P3Speller.&lt;br /&gt;
*[[Contributions:ForagingTask]]: A foraging movement task.&lt;br /&gt;
*[[Contributions:WCSTTask]]: An implementation of the Wisconsin Card Sorting Test.&lt;br /&gt;
&lt;br /&gt;
==Application Filters from the &amp;quot;private&amp;quot; section==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Access to components from the &amp;quot;private&amp;quot; section requires signing a non-disclosure agreement. Please contact brunner[at]neurotechcenter.org for more information.&lt;br /&gt;
*[[Contributions:gEstimFilter]]: Cortical stimulation with the gtec g.Estim PRO.&lt;br /&gt;
&lt;br /&gt;
==Application Modules from the &amp;quot;private&amp;quot; section==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Access to components from the &amp;quot;private&amp;quot; section requires signing a non-disclosure agreement. Please contact brunner[at]neurotechcenter.org for more information.&lt;br /&gt;
*[[VisuomotorJoystickTask]]: Center-out visuomotor reaching task using a USB HID joystick with normal and inverted cursor mappings.&lt;br /&gt;
*[[FEP_VisuomotorJoystickTask]]: Visuomotor joystick task with hidden mapping changes and cursor-gain manipulations for studying behavioral adaptation under changing sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
==Interoperability==&lt;br /&gt;
*[[Contributions:BCI2000Command]]: Remote control of BCI2000 from the command line.&lt;br /&gt;
&amp;lt;!--*[[Contributions:BCI2000Automation]]: Remote control of BCI2000 from Matlab, Scripting Engines, and .NET languages.--&amp;gt;&lt;br /&gt;
*[[Contributions:BCI2000PresentationLink]]: Using BCI2000 with the [http://www.neurobs.com/ NBS Presentation] stimulus delivery software.&lt;br /&gt;
*[[Contributions:BCI2000PythonBindings]]: Remote control of BCI2000 from Python scripts.&lt;br /&gt;
*[[Contributions:BCI2000SimulinkConnector]]: A component that exports BCI2000 data to a BCI2000 Simulink block.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User Application]][[Category:Contents]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Free_Energy_Principle_Joystick_Task&amp;diff=12595</id>
		<title>Free Energy Principle Joystick Task</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Free_Energy_Principle_Joystick_Task&amp;diff=12595"/>
		<updated>2026-09-22T19:44:31Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
Upon the completion of an SVN update, the source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from (prog folder):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12594</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12594"/>
		<updated>2026-09-22T19:39:11Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
Upon the completion of an SVN update, the source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from (prog folder):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12593</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12593"/>
		<updated>2026-09-22T19:38:56Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
Upon the completion of an SVN update, the source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12592</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12592"/>
		<updated>2026-09-22T19:38:11Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
Upon the completion of an SVN update, the source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/private/Application/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Free_Energy_Principle_Joystick_Task&amp;diff=12591</id>
		<title>Free Energy Principle Joystick Task</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Free_Energy_Principle_Joystick_Task&amp;diff=12591"/>
		<updated>2026-09-22T19:36:41Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: Created page with &amp;quot;==Synopsis==  &amp;#039;&amp;#039;&amp;#039;FEP_VisuomotorJoystickTask&amp;#039;&amp;#039;&amp;#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.  Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden enviro...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12590</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12590"/>
		<updated>2026-09-22T19:35:26Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[VisuomotorJoystickTask|Visuomotor Joystick Task]]&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12589</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12589"/>
		<updated>2026-09-22T19:33:58Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Friston, K. The free-energy principle: a unified brain theory?. Nat Rev Neurosci 11, 127–138 (2010). https://doi.org/10.1038/nrn2787&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12588</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12588"/>
		<updated>2026-09-22T19:32:04Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module implementing a center-out visuomotor reaching task designed to investigate how participants adapt their behavior when the relationship between their actions and sensory consequences changes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
Participants control a cursor using a USB HID joystick and repeatedly move from a central starting location to peripheral targets. The joystick-to-cursor mapping is treated as a hidden environmental state: on a given trial, joystick movement may produce either a normal cursor movement or an inverted cursor movement. These mappings are not explicitly cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The task was developed in the context of the &#039;&#039;&#039;Free Energy Principle (FEP)&#039;&#039;&#039; and related theories of predictive processing and active inference. In this framework, an agent maintains an internal model of the causes of its sensory observations and uses incoming evidence to update that model. When observations conflict with the agent&#039;s expectations, the agent may need to revise its estimate of the current hidden state.&lt;br /&gt;
&lt;br /&gt;
The present task operationalizes this problem using a simple visuomotor environment. The hidden state is the current joystick-to-cursor mapping. Participants first accumulate experience with particular mappings and mapping frequencies, creating different histories of prior exposure. The mapping can then change without warning, requiring the participant to infer from the resulting cursor behavior that the current sensorimotor relationship has changed.&lt;br /&gt;
&lt;br /&gt;
The task therefore allows behavioral measurements to be related to three major features of inference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Prior experience&#039;&#039;&#039;: Different experimental blocks expose participants to different frequencies of Normal and Inverted mappings.&lt;br /&gt;
* &#039;&#039;&#039;Unexpected state changes&#039;&#039;&#039;: Mapping changes may occur between trials without an explicit visual cue.&lt;br /&gt;
* &#039;&#039;&#039;Behavioral updating&#039;&#039;&#039;: Reaction time, movement time, total time, and cursor trajectory may be examined following mapping switches and across subsequent trials.&lt;br /&gt;
&lt;br /&gt;
The experiment also includes a cursor-gain manipulation. High-gain trials change the magnitude of the relationship between joystick displacement and cursor displacement. In the current implementation this is represented explicitly as a cursor-gain condition rather than as a formal sensory-reliability variable.&lt;br /&gt;
&lt;br /&gt;
Importantly, the software does not itself compute free energy, prediction error, posterior probability, Bayesian belief, or another formal FEP quantity. Instead, it creates a controlled hidden-state visuomotor task whose behavioral and neural data may be used to investigate questions motivated by those theories.&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A minimal participant introduction.&lt;br /&gt;
* A Normal-mapping joystick sandbox.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, mapping, and gain logging in the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the mapping, gain, mapping probabilities, or experimental block structure may change.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/FEP_VisuomotorJoystickTask/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.cpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/custom/CMakeLists.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Windows executable is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The current FEP task is maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt;. In the inspected development checkout, the module does not currently have independent Git or SVN revision history.&lt;br /&gt;
&lt;br /&gt;
The inspected build was produced using:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework 3.6.9535&lt;br /&gt;
* BCI2000 source revision 9535&lt;br /&gt;
* Visual Studio 2022 / MSVC 19.35&lt;br /&gt;
* Release x64 configuration&lt;br /&gt;
&lt;br /&gt;
These values refer to the BCI2000 build containing the module rather than an independent revision number for the FEP task.&lt;br /&gt;
&lt;br /&gt;
==Scientific Motivation==&lt;br /&gt;
&lt;br /&gt;
===Free Energy Principle===&lt;br /&gt;
&lt;br /&gt;
The Free Energy Principle proposes that biological agents maintain internal models of the causes of their sensory inputs and continually update those models in order to reduce discrepancies between predicted and observed sensory states.&lt;br /&gt;
&lt;br /&gt;
A useful way to interpret the present task is as a hidden-state inference problem.&lt;br /&gt;
&lt;br /&gt;
The participant directly observes:&lt;br /&gt;
&lt;br /&gt;
* Joystick movement.&lt;br /&gt;
* Cursor movement.&lt;br /&gt;
* Target position.&lt;br /&gt;
* The sensory consequences of each movement.&lt;br /&gt;
&lt;br /&gt;
The participant is not directly told:&lt;br /&gt;
&lt;br /&gt;
* Which joystick-to-cursor mapping is currently active.&lt;br /&gt;
* Whether the mapping has changed.&lt;br /&gt;
* The probability of a mapping occurring.&lt;br /&gt;
* The current experimental block.&lt;br /&gt;
* Whether cursor gain has changed.&lt;br /&gt;
&lt;br /&gt;
The current mapping therefore acts as a hidden environmental state that must be inferred from the relationship between action and observed cursor movement.&lt;br /&gt;
&lt;br /&gt;
For example, after many Normal trials, a participant may expect the cursor to move in the same direction as the joystick. If the next trial unexpectedly uses the Inverted mapping, the observed cursor movement conflicts with that expectation. Subsequent behavior can then be examined to determine how rapidly the participant adjusts to the new mapping.&lt;br /&gt;
&lt;br /&gt;
===Why the Task Was Developed===&lt;br /&gt;
&lt;br /&gt;
The task was designed to create an experimentally controlled situation in which prior experience and new sensory evidence can come into conflict.&lt;br /&gt;
&lt;br /&gt;
Several aspects of the experiment make this possible.&lt;br /&gt;
&lt;br /&gt;
First, the frequency of Normal and Inverted mappings changes across blocks. This changes the participant&#039;s recent history of mapping exposure.&lt;br /&gt;
&lt;br /&gt;
Second, mapping changes are not announced. Participants therefore cannot simply follow an explicit instruction telling them which mapping to use.&lt;br /&gt;
&lt;br /&gt;
Third, the task records the exact trials on which the mapping changes and the number of trials that have occurred since the most recent switch.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compare behavior:&lt;br /&gt;
&lt;br /&gt;
* Before and after an unexpected mapping change.&lt;br /&gt;
* On switch versus non-switch trials.&lt;br /&gt;
* Across successive trials following a switch.&lt;br /&gt;
* Under different histories of Normal and Inverted mapping exposure.&lt;br /&gt;
* Under Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
The task can therefore be used to investigate how prior experience influences behavioral adaptation to unexpected changes in sensorimotor contingencies.&lt;br /&gt;
&lt;br /&gt;
===Implementation Versus Theory===&lt;br /&gt;
&lt;br /&gt;
The current application implements the experimental manipulations required for this type of analysis, but it does not contain an explicit computational model of the participant.&lt;br /&gt;
&lt;br /&gt;
In particular, the software does not calculate:&lt;br /&gt;
&lt;br /&gt;
* Variational free energy.&lt;br /&gt;
* Prediction error.&lt;br /&gt;
* Posterior probability.&lt;br /&gt;
* Belief distributions.&lt;br /&gt;
* Bayesian surprise.&lt;br /&gt;
* Learning rate.&lt;br /&gt;
* Adaptation score.&lt;br /&gt;
&lt;br /&gt;
These quantities, if used, must be estimated during offline behavioral or neural analysis.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Mapping Conditions===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses two joystick-to-cursor mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Inverted&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The current mapping is not visually indicated to the participant.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier USBHIDJoystickTask, the FEP task does not use the terms &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; in its implementation.&lt;br /&gt;
&lt;br /&gt;
===Behavioral Measurements===&lt;br /&gt;
&lt;br /&gt;
The task records information that may be used to examine:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of trials since the previous switch.&lt;br /&gt;
* Effects of different mapping-frequency contexts.&lt;br /&gt;
* Effects of Normal versus High cursor gain.&lt;br /&gt;
&lt;br /&gt;
==Experiment Structure==&lt;br /&gt;
&lt;br /&gt;
Each run proceeds in the following order:&lt;br /&gt;
&lt;br /&gt;
# Introduction.&lt;br /&gt;
# Joystick sandbox.&lt;br /&gt;
# Experimental block 1, if enabled.&lt;br /&gt;
# Experimental block 2, if enabled.&lt;br /&gt;
# Experimental block 3, if enabled.&lt;br /&gt;
# Experimental block 4, if enabled.&lt;br /&gt;
# Experimental block 5, if enabled.&lt;br /&gt;
# Experimental block 6, if enabled.&lt;br /&gt;
# Experiment completion.&lt;br /&gt;
&lt;br /&gt;
Experimental block transitions are not announced to the participant.&lt;br /&gt;
&lt;br /&gt;
Each experimental trial proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant returns the cursor to the center.&lt;br /&gt;
# The participant holds the cursor within the center region.&lt;br /&gt;
# A yellow warning cue appears.&lt;br /&gt;
# A pre-target delay occurs.&lt;br /&gt;
# A peripheral target appears.&lt;br /&gt;
# The participant moves the cursor toward the target.&lt;br /&gt;
# The target is acquired.&lt;br /&gt;
# A short feedback interval occurs.&lt;br /&gt;
# The task advances to the next trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction provides only the minimum information needed to operate the task.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The central cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances to the sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant is not told about:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A black center cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No progress bar.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends when both of the following conditions are satisfied:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
Because continuation uses rising-edge detection, the participant must release the button after leaving the introduction screen before pressing it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; becomes 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task contains six predefined block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
A block may be omitted by setting its trial-count parameter to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when one or more blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping composition&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0, Fixed&lt;br /&gt;
| 100% Normal&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1, HiddenMixed&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2, StrongNormal&lt;br /&gt;
| Approximately 90% Normal and 10% Inverted&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3, Balanced&lt;br /&gt;
| Approximately 50% Normal and 50% Inverted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocks 4 and 6===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* All remaining trials are assigned the Normal mapping.&lt;br /&gt;
* If the number of trials is odd, the additional trial is Normal.&lt;br /&gt;
&lt;br /&gt;
===Block 5===&lt;br /&gt;
&lt;br /&gt;
Block 5 contains a strongly Normal-dominant mapping distribution.&lt;br /&gt;
&lt;br /&gt;
Approximately 10% of trials are assigned the Inverted mapping, using a rounded fixed trial count.&lt;br /&gt;
&lt;br /&gt;
The remaining trials are Normal.&lt;br /&gt;
&lt;br /&gt;
This is not implemented as an independent 10% switch probability on each trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
For blocks 4 through 6, mapping order is pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 candidate shuffles.&lt;br /&gt;
&lt;br /&gt;
A candidate is preferred when:&lt;br /&gt;
&lt;br /&gt;
* It does not strictly alternate throughout sequences of at least four trials.&lt;br /&gt;
* It does not contain excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The preferred maximum run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
If no candidate satisfies the constraints after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain order is shuffled independently from mapping order.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents the mapping-frequency context associated with the current block.&lt;br /&gt;
&lt;br /&gt;
It does not represent the immediately preceding trial&#039;s mapping.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Fixed&lt;br /&gt;
| Fixed-mapping context used in blocks 1 through 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HiddenMixed&lt;br /&gt;
| Approximately balanced hidden mapping context used in block 4.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| StrongNormal&lt;br /&gt;
| Strongly Normal-dominant mapping context used in block 5.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Balanced&lt;br /&gt;
| Approximately balanced mapping context used in block 6.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The mapping used on the preceding trial may be determined offline from the previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joystick X and Y values normally range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The converted value is normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself enable joystick logging.&lt;br /&gt;
&lt;br /&gt;
Joystick logging should therefore be enabled using BCI2000&#039;s &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mapping==&lt;br /&gt;
&lt;br /&gt;
Before target onset, cursor position normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mapping transformation used for target-directed movement is activated at target onset.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
When the target appears, the application stores:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the anchor is initially zero, activating the transformed mapping does not cause an immediate cursor jump.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with gain 1.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor coordinates are constrained to the valid display range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task contains two cursor-gain conditions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
! Gain&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Normal&lt;br /&gt;
| 1.0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| High&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High gain:&lt;br /&gt;
&lt;br /&gt;
* Applies to both X and Y axes.&lt;br /&gt;
* Multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
* Is used only in randomized blocks 4 through 6.&lt;br /&gt;
* Is shuffled independently from mapping condition.&lt;br /&gt;
* Is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; state or parameter.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or High-gain trial, the previous transformed mapping may temporarily remain active while the participant returns the joystick toward its previous anchor.&lt;br /&gt;
&lt;br /&gt;
The stored transformation is released once both joystick axes are within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is then restored for ordinary centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps between transformed target movement and subsequent centering.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not produce mapping-switch events.&lt;br /&gt;
&lt;br /&gt;
Mapping switches occur only at trial boundaries.&lt;br /&gt;
&lt;br /&gt;
They do not occur:&lt;br /&gt;
&lt;br /&gt;
* During target-directed movement.&lt;br /&gt;
* During the Feedback phase before the feedback interval ends.&lt;br /&gt;
&lt;br /&gt;
The new mapping is selected when the task advances into the next trial.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a new trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurred.&lt;br /&gt;
&lt;br /&gt;
It should therefore be interpreted as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; records how many consecutive no-switch trial transitions have occurred since the most recent mapping change.&lt;br /&gt;
&lt;br /&gt;
Behavior is:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* First trial following a mapping switch: 0.&lt;br /&gt;
* Next same-mapping trial: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first experimental trial also begins at 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; by itself does not identify a switch.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; or a transition in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; to identify mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Consider the following mapping sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within block 4, the corresponding states would behave approximately as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Depends on previous trial history&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Normal&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| Previous value + 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on the transition processing block&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Inverted&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; ranges from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target coordinates are generated according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to an approximately circular 300-pixel radius in the nominal 1000 by 750 design.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are black.&lt;br /&gt;
* Are visually identical across all mapping conditions.&lt;br /&gt;
* Are visually identical across gain conditions.&lt;br /&gt;
* Are not determined by mapping condition.&lt;br /&gt;
* Are not determined by gain condition.&lt;br /&gt;
* Are not determined by mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Do not appear during the introduction.&lt;br /&gt;
* Do not appear during the sandbox.&lt;br /&gt;
&lt;br /&gt;
A new target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
The current experimental phase is stored in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
! Participant display&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Introduction / Sandbox&lt;br /&gt;
| No active experimental trial&lt;br /&gt;
| Introduction text or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| WaitingForCenter&lt;br /&gt;
| Waiting for cursor to enter the center region&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| HoldingCenter&lt;br /&gt;
| Required uninterrupted center hold&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| Warning interval&lt;br /&gt;
| Cursor, yellow warning marker, cross&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PreTargetDelay&lt;br /&gt;
| Delay immediately before target appearance&lt;br /&gt;
| Cursor, gray center, cross&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TargetVisible&lt;br /&gt;
| Target-directed movement&lt;br /&gt;
| Cursor, black target, cross&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| Post-acquisition interval&lt;br /&gt;
| Cursor and cross&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| Experiment complete&lt;br /&gt;
| End message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by a transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing window contains:&lt;br /&gt;
&lt;br /&gt;
* A light background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A black peripheral target.&lt;br /&gt;
* An experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox instructions.&lt;br /&gt;
* An experiment-completion message.&lt;br /&gt;
&lt;br /&gt;
The participant receives no explicit visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Current mapping.&lt;br /&gt;
* Current gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The target remains black across conditions.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success-color cue. The target disappears after successful acquisition.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During experimental trials it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current task stage.&lt;br /&gt;
* Original block number.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current Normal or Inverted mapping.&lt;br /&gt;
* Current Normal or High cursor-gain condition.&lt;br /&gt;
* Actual gain value.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; is recorded in the data stream but is not currently displayed in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RESET CURRENT TRIAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic Continue button for the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears target-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears timing states.&lt;br /&gt;
* Resets baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; lasts for one processing block.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing uses &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected during BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective timing resolution is limited by the signal-processing block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when the center-hold phase begins and updated during center holding.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than 8 task-coordinate units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and stored in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed in rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
Timing states remain populated through the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Inverted trials in block 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 5&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal trials in block 3&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of Normal-dominant trials in block 5&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| 20&lt;br /&gt;
| 0-10000&lt;br /&gt;
| Number of approximately balanced trials in block 6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===HighCursorGain===&lt;br /&gt;
&lt;br /&gt;
Gain used during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.0-5.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Required center-hold duration.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0-60.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning interval.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the warning interval and target onset.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback interval following target acquisition.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seconds.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical monitor used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows systems, available monitors are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible horizontal cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Participant-visible vertical cursor coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 3 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current task phase&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal, 1 Inverted&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
| 12 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target angle in tenths of a degree&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Horizontal target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
| 10 bit&lt;br /&gt;
| 512&lt;br /&gt;
| Vertical target coordinate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current experimental block role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Overall experimental trial number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Indicates detected movement onset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Target-acquisition event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Manual-reset event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Mapping-change event&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Trials since the most recent mapping switch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Current block-level prior context&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 Normal gain, 1 High gain&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 1 during introduction or sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4 bit&lt;br /&gt;
| 0&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Reaction time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Movement time in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32 bit&lt;br /&gt;
| 0&lt;br /&gt;
| Total target-directed time in milliseconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw horizontal joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Raw vertical joystick position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Joystick button used to advance the introduction and sandbox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present in the Current Implementation===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant.&lt;br /&gt;
&lt;br /&gt;
These coordinates include any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Drawing the participant-visible cursor.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state recording.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
The application does not record a separate untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
A direct joystick-equivalent trajectory may be reconstructed offline from &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as synchronized BCI2000 states in the standard &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Recorded information includes:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Joystick trajectory, when joystick logging is enabled.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Experimental block.&lt;br /&gt;
* Experimental trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction and sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement or Event&lt;br /&gt;
! Recommended Identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Introduction&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Sandbox&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; from 1 through 6&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Inverted mapping&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Normal gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| High gain&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mapping switch&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Trials since switch&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Previous mapping&lt;br /&gt;
| Previous trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prior context&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Overall trial&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees&lt;br /&gt;
|-&lt;br /&gt;
| Target position&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Joystick trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Participant-visible cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experiment completion&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Event-Like States===&lt;br /&gt;
&lt;br /&gt;
The following states are one-processing-block events:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; differs from these states because it remains high from movement onset through the remainder of the trial and Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* USB joystick input.&lt;br /&gt;
* Center-out reaching.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Warning interval.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control mappings.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task removes the earlier task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only and Controlled-only modes.&lt;br /&gt;
* Ordered-start condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green versus red condition-specific targets.&lt;br /&gt;
* Explicit condition instructions.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial setting.&lt;br /&gt;
* Diagnostic Continue button.&lt;br /&gt;
* Secondary CSV results file.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Six predefined experimental block roles.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* Unannounced mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus High cursor gain.&lt;br /&gt;
* A minimal Normal-mapping sandbox.&lt;br /&gt;
* Black targets across all mapping conditions.&lt;br /&gt;
* Normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The current module does not implement an explicit computational Free Energy Principle model.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; represents experimental block context rather than an inferred participant belief.&lt;br /&gt;
* Participant surprise or expectation is not measured directly by the application.&lt;br /&gt;
* Blocks 4 and 6 use similar approximately balanced mapping-generation rules but occur after different preceding mapping histories.&lt;br /&gt;
* Mapping pseudorandomization constraints are attempted but are not guaranteed if all 64 candidate sequences fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation rather than as a state explicitly named sensory reliability.&lt;br /&gt;
* There is no separately recorded latent or untransformed cursor trajectory.&lt;br /&gt;
* Physical display geometry depends on the configured participant monitor and BCI2000 window dimensions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
No scientific paper is currently cited directly in the &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask&amp;lt;/code&amp;gt; source code.&lt;br /&gt;
&lt;br /&gt;
References describing the Free Energy Principle, active inference, predictive processing, or the scientific motivation for the present experimental design may be added here when the study&#039;s final reference set is established.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12587</id>
		<title>FEP VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=FEP_VisuomotorJoystickTask&amp;diff=12587"/>
		<updated>2026-09-22T19:27:26Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: Created page with &amp;quot;==Synopsis==  &amp;#039;&amp;#039;&amp;#039;FEP_VisuomotorJoystickTask&amp;#039;&amp;#039;&amp;#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task presents hidden changes in the relationship between joystick movement and cursor movement while recording behavioral responses synchronized with the BCI2000 data stream.  The task includes:  * Normal and inverted joystick-to-cursor mappings. * Unannounced mapping changes between trials. * Six seq...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FEP_VisuomotorJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task presents hidden changes in the relationship between joystick movement and cursor movement while recording behavioral responses synchronized with the BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
The task includes:&lt;br /&gt;
&lt;br /&gt;
* Normal and inverted joystick-to-cursor mappings.&lt;br /&gt;
* Unannounced mapping changes between trials.&lt;br /&gt;
* Six sequential experimental block roles with different mapping frequencies.&lt;br /&gt;
* Normal and configurable high cursor-gain conditions.&lt;br /&gt;
* Mapping-switch, prior-condition, and trials-since-switch state logging.&lt;br /&gt;
* A mandatory minimal introduction.&lt;br /&gt;
* A normal-mapping sandbox for joystick familiarization.&lt;br /&gt;
* Reaction-time, movement-time, total-time, cursor, joystick, target, condition, and gain logging in the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
The participant is not informed that the joystick-to-cursor mapping, cursor gain, mapping probabilities, or block structure may change. Targets are displayed identically across conditions so that the current mapping is not visually cued.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not calculate free energy, posterior probability, prediction error, or another explicit computational quantity associated with the Free Energy Principle. The application instead provides an experimental framework for manipulating hidden visuomotor mappings, recent mapping history, mapping frequency, and cursor gain while measuring behavioral adaptation.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the FEP Visuomotor Joystick Task is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;src/custom/FEP_VisuomotorJoystickTask/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application is included from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;src/custom/CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target and Windows executable are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP_VisuomotorJoystickTask&lt;br /&gt;
FEP_VisuomotorJoystickTask.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis&lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: [speer@wustl.edu](mailto:speer@wustl.edu)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The FEP module is currently maintained under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and does not have independent Git or SVN revision history in the inspected development checkout.&lt;br /&gt;
&lt;br /&gt;
Build metadata associated with the inspected implementation reports:&lt;br /&gt;
&lt;br /&gt;
* BCI2000 framework: &#039;&#039;&#039;3.6.9535&#039;&#039;&#039;&lt;br /&gt;
* BCI2000 source revision: &#039;&#039;&#039;9535&#039;&#039;&#039;&lt;br /&gt;
* Release configuration: &#039;&#039;&#039;x64&#039;&#039;&#039;&lt;br /&gt;
* Compiler: &#039;&#039;&#039;MSVC 19.35.32215.0&#039;&#039;&#039;&lt;br /&gt;
* Build date of inspected Release build: &#039;&#039;&#039;September 18, 2026&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These values describe the BCI2000 build containing the module and should not be interpreted as an independent revision number for &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
No task-specific &amp;lt;code&amp;gt;.prm&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.bat&amp;lt;/code&amp;gt; file was found in the inspected source tree.&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Motivation===&lt;br /&gt;
&lt;br /&gt;
The task repeatedly requires participants to make center-out joystick movements toward peripheral visual targets.&lt;br /&gt;
&lt;br /&gt;
Across trials, the application manipulates:&lt;br /&gt;
&lt;br /&gt;
* Whether joystick displacement moves the cursor in the same or opposite direction.&lt;br /&gt;
* Whether cursor displacement uses normal gain or increased gain.&lt;br /&gt;
* The frequency of normal and inverted mappings within a block.&lt;br /&gt;
* The sequence of mapping exposure across blocks.&lt;br /&gt;
* Whether a trial immediately follows a change in mapping.&lt;br /&gt;
&lt;br /&gt;
The resulting data may be used to examine behavioral consequences of recent mapping history, mapping changes, mapping frequency, and cursor gain.&lt;br /&gt;
&lt;br /&gt;
Examples of behavioral quantities available from the recorded data include:&lt;br /&gt;
&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total target-acquisition time.&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Initial movement direction.&lt;br /&gt;
* Trajectory curvature.&lt;br /&gt;
* Performance immediately following a mapping switch.&lt;br /&gt;
* Performance as a function of the number of trials since a mapping switch.&lt;br /&gt;
* Differences between normal-dominant and approximately balanced mapping contexts.&lt;br /&gt;
* Interactions between mapping and cursor gain.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not contain an explicit Bayesian model, posterior estimate, prediction-error calculation, adaptation score, or free-energy calculation.&lt;br /&gt;
&lt;br /&gt;
===Condition Terminology===&lt;br /&gt;
&lt;br /&gt;
The FEP task uses the terms &#039;&#039;&#039;Normal&#039;&#039;&#039; and &#039;&#039;&#039;Inverted&#039;&#039;&#039; rather than the &#039;&#039;&#039;Automatic&#039;&#039;&#039; and &#039;&#039;&#039;Controlled&#039;&#039;&#039; terminology used by the earlier USBHIDJoystickTask.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Mapping&lt;br /&gt;
&lt;br /&gt;
| ! Description                                                                  |&lt;br /&gt;
| ------------------------------------------------------------------------------ |&lt;br /&gt;
| 0                                                                              |&lt;br /&gt;
| Normal                                                                         |&lt;br /&gt;
| Joystick displacement moves the cursor in the corresponding direction.         |&lt;br /&gt;
| -                                                                              |&lt;br /&gt;
| 1                                                                              |&lt;br /&gt;
| Inverted                                                                       |&lt;br /&gt;
| Joystick displacement moves the cursor in the opposite direction on both axes. |&lt;br /&gt;
| }                                                                              |&lt;br /&gt;
&lt;br /&gt;
The current condition is not shown to the participant.&lt;br /&gt;
&lt;br /&gt;
==Experiment Overview==&lt;br /&gt;
&lt;br /&gt;
Each run begins with:&lt;br /&gt;
&lt;br /&gt;
# A minimal introduction screen.&lt;br /&gt;
&lt;br /&gt;
# A free-movement joystick sandbox.&lt;br /&gt;
&lt;br /&gt;
# The first active experimental block.&lt;br /&gt;
&lt;br /&gt;
# Sequential experimental trials across as many as six block roles.&lt;br /&gt;
&lt;br /&gt;
# A completion screen when all configured trials have finished.&lt;br /&gt;
&lt;br /&gt;
There are no participant-facing block announcements between experimental blocks.&lt;br /&gt;
&lt;br /&gt;
The standard experimental trial sequence is:&lt;br /&gt;
&lt;br /&gt;
# Waiting for center.&lt;br /&gt;
&lt;br /&gt;
# Holding center.&lt;br /&gt;
&lt;br /&gt;
# Warning.&lt;br /&gt;
&lt;br /&gt;
# Pre-target delay.&lt;br /&gt;
&lt;br /&gt;
# Target appearance.&lt;br /&gt;
&lt;br /&gt;
# Target-directed movement.&lt;br /&gt;
&lt;br /&gt;
# Target acquisition.&lt;br /&gt;
&lt;br /&gt;
# Feedback.&lt;br /&gt;
&lt;br /&gt;
# Advance to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
A new target is generated after each successfully completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The introduction is mandatory in the current implementation.&lt;br /&gt;
&lt;br /&gt;
During the introduction:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* The cursor is hidden.&lt;br /&gt;
* The center marker is hidden.&lt;br /&gt;
* The warning cue is hidden.&lt;br /&gt;
* The target is hidden.&lt;br /&gt;
* The fixation cross is hidden.&lt;br /&gt;
* The progress bar is hidden.&lt;br /&gt;
* Experimental block, trial, target, mapping, gain, switch, prior, and timing states are zeroed.&lt;br /&gt;
&lt;br /&gt;
The participant is shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use the joystick to control the cursor.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each trial, return the cursor to the center and hold it there.&lt;br /&gt;
&lt;br /&gt;
The center will turn yellow before the target appears.&lt;br /&gt;
&lt;br /&gt;
Once the target appears, move the cursor to the target.&lt;br /&gt;
&lt;br /&gt;
Press the joystick button to continue.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A rising press of &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; advances the participant to the sandbox.&lt;br /&gt;
&lt;br /&gt;
Holding the button does not repeatedly advance the introduction because continuation uses rising-edge detection.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window does not contain a separate introduction-continuation button.&lt;br /&gt;
&lt;br /&gt;
==Sandbox==&lt;br /&gt;
&lt;br /&gt;
After the introduction, the participant enters a free-movement sandbox.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* The black cursor.&lt;br /&gt;
* The gray center.&lt;br /&gt;
* The central cross.&lt;br /&gt;
* No peripheral target.&lt;br /&gt;
* No warning cue.&lt;br /&gt;
* No experimental progress bar.&lt;br /&gt;
&lt;br /&gt;
The screen displays:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Practice moving the cursor with the joystick.&lt;br /&gt;
&lt;br /&gt;
When you are ready to begin, return the cursor to the center and press the joystick button.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the sandbox:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskTrial=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition=0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Normal direct mapping is used.&lt;br /&gt;
* Cursor gain is 1.0.&lt;br /&gt;
* No targets are generated.&lt;br /&gt;
* No experimental timing phases occur.&lt;br /&gt;
&lt;br /&gt;
The sandbox ends only when:&lt;br /&gt;
&lt;br /&gt;
# The cursor is inside the center tolerance region.&lt;br /&gt;
&lt;br /&gt;
# A new joystick-button press occurs.&lt;br /&gt;
&lt;br /&gt;
The participant must release the button after leaving the introduction screen and press it again to leave the sandbox.&lt;br /&gt;
&lt;br /&gt;
When the sandbox finishes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; changes to 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; changes to 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; becomes 1.&lt;br /&gt;
* Experimental block and trial states become active.&lt;br /&gt;
&lt;br /&gt;
The introduction and sandbox do not tell the participant about:&lt;br /&gt;
&lt;br /&gt;
* Inverted mappings.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Cursor-gain changes.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Experimental blocks.&lt;br /&gt;
* Prior conditions.&lt;br /&gt;
&lt;br /&gt;
==Experimental Blocks==&lt;br /&gt;
&lt;br /&gt;
The task uses a fixed sequence of six possible block roles.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
Any block whose trial-count parameter is set to 0 is omitted. &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; retains the original block-role number, so block numbers may skip values when blocks are disabled.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Block&lt;br /&gt;
! Trial-count parameter&lt;br /&gt;
! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| ! Mapping composition                   |&lt;br /&gt;
| --------------------------------------- |&lt;br /&gt;
| 1                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;             |&lt;br /&gt;
| 0, Fixed                                |&lt;br /&gt;
| 100% Normal                             |&lt;br /&gt;
| -                                       |&lt;br /&gt;
| 2                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;      |&lt;br /&gt;
| 0, Fixed                                |&lt;br /&gt;
| 100% Inverted                           |&lt;br /&gt;
| -                                       |&lt;br /&gt;
| 3                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;         |&lt;br /&gt;
| 0, Fixed                                |&lt;br /&gt;
| 100% Normal                             |&lt;br /&gt;
| -                                       |&lt;br /&gt;
| 4                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;                |&lt;br /&gt;
| 1, HiddenMixed                          |&lt;br /&gt;
| Approximately 50% Normal / 50% Inverted |&lt;br /&gt;
| -                                       |&lt;br /&gt;
| 5                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;          |&lt;br /&gt;
| 2, StrongNormal                         |&lt;br /&gt;
| Approximately 90% Normal / 10% Inverted |&lt;br /&gt;
| -                                       |&lt;br /&gt;
| 6                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;        |&lt;br /&gt;
| 3, Balanced                             |&lt;br /&gt;
| Approximately 50% Normal / 50% Inverted |&lt;br /&gt;
| }                                       |&lt;br /&gt;
&lt;br /&gt;
For blocks 4 and 6:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;floor(N/2)&amp;lt;/code&amp;gt; trials are assigned the Inverted mapping.&lt;br /&gt;
* Remaining trials use the Normal mapping.&lt;br /&gt;
* If the trial count is odd, Normal receives the additional trial.&lt;br /&gt;
&lt;br /&gt;
For block 5:&lt;br /&gt;
&lt;br /&gt;
* The number of Inverted trials is computed as approximately 10% of the block using rounding.&lt;br /&gt;
* Remaining trials are Normal.&lt;br /&gt;
* This is a fixed-count composition rather than an independent 10% probability on every trial.&lt;br /&gt;
&lt;br /&gt;
===Pseudorandomization===&lt;br /&gt;
&lt;br /&gt;
Mappings in blocks 4 through 6 are pseudorandomized.&lt;br /&gt;
&lt;br /&gt;
The task attempts up to 64 shuffles and prefers sequences that:&lt;br /&gt;
&lt;br /&gt;
* Do not strictly alternate when the sequence contains at least four trials.&lt;br /&gt;
* Avoid excessively long runs of one mapping.&lt;br /&gt;
&lt;br /&gt;
The maximum preferred run length is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
max(3, unavoidableRun + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unavoidableRun = (majority + minority) / (minority + 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using integer division.&lt;br /&gt;
&lt;br /&gt;
These restrictions are attempted rather than absolutely guaranteed. If no acceptable sequence is found after 64 attempts, the final generated sequence is used.&lt;br /&gt;
&lt;br /&gt;
Cursor-gain conditions are shuffled independently from mapping conditions. Mapping-by-gain combinations are therefore not explicitly balanced.&lt;br /&gt;
&lt;br /&gt;
==Prior Conditions==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; identifies the block-level mapping context.&lt;br /&gt;
&lt;br /&gt;
It does &#039;&#039;&#039;not&#039;&#039;&#039; represent the mapping used on the immediately preceding trial.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Code label&lt;br /&gt;
&lt;br /&gt;
| ! Meaning                                     |&lt;br /&gt;
| --------------------------------------------- |&lt;br /&gt;
| 0                                             |&lt;br /&gt;
| Fixed                                         |&lt;br /&gt;
| Fixed-mapping blocks 1 through 3              |&lt;br /&gt;
| -                                             |&lt;br /&gt;
| 1                                             |&lt;br /&gt;
| HiddenMixed                                   |&lt;br /&gt;
| Approximately balanced hidden-mapping block 4 |&lt;br /&gt;
| -                                             |&lt;br /&gt;
| 2                                             |&lt;br /&gt;
| StrongNormal                                  |&lt;br /&gt;
| Normal-dominant block 5                       |&lt;br /&gt;
| -                                             |&lt;br /&gt;
| 3                                             |&lt;br /&gt;
| Balanced                                      |&lt;br /&gt;
| Approximately balanced block 6                |&lt;br /&gt;
| }                                             |&lt;br /&gt;
&lt;br /&gt;
The previous trial&#039;s mapping may be reconstructed offline from the preceding trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Joystick Input==&lt;br /&gt;
&lt;br /&gt;
Joystick input is supplied through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
The application expects:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The X and Y joystick states are expected to range from 0 through 32767.&lt;br /&gt;
&lt;br /&gt;
Each axis is converted into the task&#039;s 0-through-1023 coordinate system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
taskJoystick = round(BCIJoystick * 1023 / 32767)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and normalized internally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rawPosition = taskJoystick / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FEP application does not itself publish or enable &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt;. Joystick input logging must therefore be enabled in the BCI2000 configuration.&lt;br /&gt;
&lt;br /&gt;
See [[User Reference:Logging Input#LogJoystick|LogJoystick]].&lt;br /&gt;
&lt;br /&gt;
==Joystick-to-Cursor Mappings==&lt;br /&gt;
&lt;br /&gt;
Before target onset, the cursor normally follows direct absolute joystick position:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = rawX&lt;br /&gt;
cursorY = rawY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current trial&#039;s mapping and gain conditions are already represented in their corresponding BCI2000 states during the preparation phases, but transformed movement normally begins only when the target appears.&lt;br /&gt;
&lt;br /&gt;
===Anchor Capture===&lt;br /&gt;
&lt;br /&gt;
At target onset, the application records:&lt;br /&gt;
&lt;br /&gt;
* Current joystick X position.&lt;br /&gt;
* Current joystick Y position.&lt;br /&gt;
* Current cursor X position.&lt;br /&gt;
* Current cursor Y position.&lt;br /&gt;
* Current mapping direction.&lt;br /&gt;
* Current cursor gain.&lt;br /&gt;
&lt;br /&gt;
These values form the anchor for transformed target-directed movement.&lt;br /&gt;
&lt;br /&gt;
Because joystick displacement relative to the new anchor is initially zero, activating a transformed mapping does not produce an immediate cursor jump at target onset.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal trial with normal gain, cursor position remains direct and absolute:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = joystickX / 1023&lt;br /&gt;
cursorY = joystickY / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, Normal Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX - (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
cursorY = anchorCursorY - (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both axes are inverted. This corresponds to a 180-degree reversal of joystick displacement around the target-onset anchor.&lt;br /&gt;
&lt;br /&gt;
===Normal Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For a Normal high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          + HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          + HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inverted Mapping, High Gain===&lt;br /&gt;
&lt;br /&gt;
For an Inverted high-gain trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursorX = anchorCursorX&lt;br /&gt;
          - HighCursorGain * (joystickX - anchorJoystickX) / 1023&lt;br /&gt;
&lt;br /&gt;
cursorY = anchorCursorY&lt;br /&gt;
          - HighCursorGain * (joystickY - anchorJoystickY) / 1023&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cursor position is constrained to the valid participant-display coordinate range.&lt;br /&gt;
&lt;br /&gt;
==Cursor Gain==&lt;br /&gt;
&lt;br /&gt;
The task implements two cursor-gain conditions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! Condition&lt;br /&gt;
&lt;br /&gt;
| ! Gain                      |&lt;br /&gt;
| --------------------------- |&lt;br /&gt;
| 0                           |&lt;br /&gt;
| Normal                      |&lt;br /&gt;
| 1.0                         |&lt;br /&gt;
| -                           |&lt;br /&gt;
| 1                           |&lt;br /&gt;
| High                        |&lt;br /&gt;
| &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; |&lt;br /&gt;
| }                           |&lt;br /&gt;
&lt;br /&gt;
The default value of &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The high-gain transformation multiplies joystick displacement relative to the target-onset anchor.&lt;br /&gt;
&lt;br /&gt;
It applies to both the X and Y axes.&lt;br /&gt;
&lt;br /&gt;
High-gain conditions occur in randomized blocks 4 through 6 and are shuffled independently from the mapping sequence.&lt;br /&gt;
&lt;br /&gt;
Gain condition is not visually cued to the participant.&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define a &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt; parameter or state. Earlier development versions included sensory-reliability and cursor-jitter mechanisms, but these are not part of the current implementation.&lt;br /&gt;
&lt;br /&gt;
==Return-to-Anchor Behavior==&lt;br /&gt;
&lt;br /&gt;
After an Inverted or high-gain trial, the anchored transform may remain active temporarily while the participant returns the joystick toward its target-onset anchor.&lt;br /&gt;
&lt;br /&gt;
The previous anchor, direction, and gain remain active until both joystick axes return within 8 task-coordinate units of the previous joystick anchor.&lt;br /&gt;
&lt;br /&gt;
The application then returns to direct absolute mapping for ordinary trial centering.&lt;br /&gt;
&lt;br /&gt;
This behavior reduces abrupt cursor jumps when leaving an inverted or high-gain mapping.&lt;br /&gt;
&lt;br /&gt;
The 8-unit deadzone is used for:&lt;br /&gt;
&lt;br /&gt;
* Movement-onset detection.&lt;br /&gt;
* Return-to-anchor detection.&lt;br /&gt;
&lt;br /&gt;
It is not used as a continuous joystick smoothing filter.&lt;br /&gt;
&lt;br /&gt;
==Mapping Switches==&lt;br /&gt;
&lt;br /&gt;
A mapping switch occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
next trial TaskCondition != completed trial TaskCondition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gain changes alone do not count as mapping switches.&lt;br /&gt;
&lt;br /&gt;
Mapping switches are evaluated after the completed trial&#039;s feedback interval while advancing to the next trial.&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
* Mapping does not switch during target-directed movement.&lt;br /&gt;
* Mapping does not switch during the active feedback interval.&lt;br /&gt;
* The new condition becomes active when the next trial is selected.&lt;br /&gt;
* The new trial begins in &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The new trial&#039;s mapping transformation normally affects cursor movement beginning at target onset.&lt;br /&gt;
&lt;br /&gt;
===MappingSwitch State===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; is an event-like state.&lt;br /&gt;
&lt;br /&gt;
It is:&lt;br /&gt;
&lt;br /&gt;
* 1 on the processing block that advances into a trial whose mapping differs from the completed trial.&lt;br /&gt;
* 0 on the following processing block.&lt;br /&gt;
* 0 when no mapping change occurs.&lt;br /&gt;
&lt;br /&gt;
It should therefore be treated as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialsSinceMappingSwitch===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt; is a persistent counter.&lt;br /&gt;
&lt;br /&gt;
Behavior:&lt;br /&gt;
&lt;br /&gt;
* First experimental trial: 0.&lt;br /&gt;
* Trial immediately following a mapping switch: 0.&lt;br /&gt;
* Next trial with the same mapping: 1.&lt;br /&gt;
* Next same-mapping trial: 2.&lt;br /&gt;
* And so forth.&lt;br /&gt;
&lt;br /&gt;
Because the first trial of the experiment also begins with a value of 0, &amp;lt;code&amp;gt;TrialsSinceMappingSwitch==0&amp;lt;/code&amp;gt; alone does not prove that a switch occurred.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;, a change in &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;, or exclusion of the first experimental trial when identifying actual switch events.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Suppose a portion of block 4 contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal -&amp;gt; Normal -&amp;gt; Inverted -&amp;gt; Inverted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Trial&lt;br /&gt;
! &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| ! &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; |&lt;br /&gt;
| ----------------------------- |&lt;br /&gt;
| First Normal                  |&lt;br /&gt;
| 0                             |&lt;br /&gt;
| 0                             |&lt;br /&gt;
| Depends on preceding sequence |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| -                             |&lt;br /&gt;
| Second Normal                 |&lt;br /&gt;
| 0                             |&lt;br /&gt;
| 0                             |&lt;br /&gt;
| Previous value + 1            |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| -                             |&lt;br /&gt;
| First Inverted                |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| 1 during transition block     |&lt;br /&gt;
| 0                             |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| -                             |&lt;br /&gt;
| Second Inverted               |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| 0                             |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| 1                             |&lt;br /&gt;
| }                             |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; remains 1 because all four trials occur within the HiddenMixed block.&lt;br /&gt;
&lt;br /&gt;
==Target Generation==&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for every new experimental trial.&lt;br /&gt;
&lt;br /&gt;
The generator produces an integer from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 through 3599&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; is expressed in tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Targets therefore span:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0.0 through 359.9 degrees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in 0.1-degree increments.&lt;br /&gt;
&lt;br /&gt;
Target position is computed using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetX = 0.5 + 0.3 * cos(angle)&lt;br /&gt;
TargetY = 0.5 + 0.4 * sin(angle)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unequal normalized X and Y radii correspond to a nominal circular target radius of approximately 300 pixels in the application&#039;s 1000 x 750 reference geometry.&lt;br /&gt;
&lt;br /&gt;
Approximate 0-through-1023 target-state ranges are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;: 205 through 818.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;: 102 through 921.&lt;br /&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
* Are generated continuously around the center rather than from a small fixed set of positions.&lt;br /&gt;
* Are not selected according to mapping condition.&lt;br /&gt;
* Are not selected according to gain condition.&lt;br /&gt;
* Are not selected according to mapping-switch status.&lt;br /&gt;
* May repeat.&lt;br /&gt;
* Are not explicitly angularly balanced.&lt;br /&gt;
* Are black in every experimental condition.&lt;br /&gt;
* Do not appear during the introduction or sandbox.&lt;br /&gt;
&lt;br /&gt;
A target is generated:&lt;br /&gt;
&lt;br /&gt;
* For the first experimental trial.&lt;br /&gt;
* After each completed non-final trial.&lt;br /&gt;
&lt;br /&gt;
Resetting the current trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
==Experimental Trial Sequence==&lt;br /&gt;
&lt;br /&gt;
===Waiting for Center===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The participant moves the cursor into the center region.&lt;br /&gt;
&lt;br /&gt;
The participant sees:&lt;br /&gt;
&lt;br /&gt;
* Cursor.&lt;br /&gt;
* Gray center marker.&lt;br /&gt;
* Central cross.&lt;br /&gt;
&lt;br /&gt;
Normal direct mapping is normally used during centering, except while completing return-to-anchor behavior from a previous transformed trial.&lt;br /&gt;
&lt;br /&gt;
===Holding Center===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once centered, the participant must remain within the center tolerance region for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Leaving the center before the hold completes restarts center acquisition.&lt;br /&gt;
&lt;br /&gt;
During this phase, the application also accumulates the joystick baseline used for later movement-onset detection.&lt;br /&gt;
&lt;br /&gt;
===Warning===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A larger yellow warning marker is displayed for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered.&lt;br /&gt;
&lt;br /&gt;
Leaving the center restarts the preparation sequence.&lt;br /&gt;
&lt;br /&gt;
===Pre-Target Delay===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The warning cue is removed and the task waits for &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered.&lt;br /&gt;
&lt;br /&gt;
===Target Visible===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peripheral black target appears.&lt;br /&gt;
&lt;br /&gt;
At target onset:&lt;br /&gt;
&lt;br /&gt;
* The joystick anchor is captured.&lt;br /&gt;
* The cursor anchor is captured.&lt;br /&gt;
* The selected mapping becomes behaviorally active.&lt;br /&gt;
* The selected gain becomes behaviorally active.&lt;br /&gt;
* The target-onset timestamp is recorded.&lt;br /&gt;
&lt;br /&gt;
The participant then moves the cursor toward the target.&lt;br /&gt;
&lt;br /&gt;
===Feedback===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cursor reaches the target:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; pulses.&lt;br /&gt;
* Timing measurements are calculated.&lt;br /&gt;
* The target disappears.&lt;br /&gt;
* The task remains in feedback for &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After feedback expires, the application advances to the next trial or finishes the experiment.&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TaskPhase=7&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The participant display shows an end message and the run terminates by setting the standard BCI2000 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; state to 0.&lt;br /&gt;
&lt;br /&gt;
==Trial Phases==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Meaning&lt;br /&gt;
&lt;br /&gt;
| ! Participant display                     |&lt;br /&gt;
| ----------------------------------------- |&lt;br /&gt;
| 0                                         |&lt;br /&gt;
| Introduction / Sandbox                    |&lt;br /&gt;
| No active experimental trial phase        |&lt;br /&gt;
| Introduction text or sandbox display      |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 1                                         |&lt;br /&gt;
| WaitingForCenter                          |&lt;br /&gt;
| Waiting for cursor to enter center region |&lt;br /&gt;
| Cursor, gray center, cross                |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 2                                         |&lt;br /&gt;
| HoldingCenter                             |&lt;br /&gt;
| Required uninterrupted center hold        |&lt;br /&gt;
| Cursor, gray center, cross                |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 3                                         |&lt;br /&gt;
| Warning                                   |&lt;br /&gt;
| Warning interval                          |&lt;br /&gt;
| Cursor, yellow warning marker, cross      |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 4                                         |&lt;br /&gt;
| PreTargetDelay                            |&lt;br /&gt;
| Delay immediately before target onset     |&lt;br /&gt;
| Cursor, gray center, cross                |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 5                                         |&lt;br /&gt;
| TargetVisible                             |&lt;br /&gt;
| Target-directed movement                  |&lt;br /&gt;
| Cursor, black target, cross               |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 6                                         |&lt;br /&gt;
| Feedback                                  |&lt;br /&gt;
| Post-acquisition interval                 |&lt;br /&gt;
| Cursor and cross; target hidden           |&lt;br /&gt;
| -                                         |&lt;br /&gt;
| 7                                         |&lt;br /&gt;
| Finished                                  |&lt;br /&gt;
| Experiment complete                       |&lt;br /&gt;
| End message                               |&lt;br /&gt;
| }                                         |&lt;br /&gt;
&lt;br /&gt;
An experimental target onset may be identified by transition into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskPhase == 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement onset may be identified by a rising transition of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MovementStarted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Target acquisition is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Participant Display==&lt;br /&gt;
&lt;br /&gt;
The participant-facing application window contains:&lt;br /&gt;
&lt;br /&gt;
* Cursor.&lt;br /&gt;
* Central fixation cross.&lt;br /&gt;
* Gray center marker.&lt;br /&gt;
* Larger yellow warning marker.&lt;br /&gt;
* Black peripheral target.&lt;br /&gt;
* Experimental progress indicator.&lt;br /&gt;
* Introduction and sandbox text.&lt;br /&gt;
* Experiment-completion text.&lt;br /&gt;
&lt;br /&gt;
The black target is identical across mapping and gain conditions.&lt;br /&gt;
&lt;br /&gt;
The participant receives no visual indication of:&lt;br /&gt;
&lt;br /&gt;
* Normal versus Inverted mapping.&lt;br /&gt;
* Normal versus High gain.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
&lt;br /&gt;
The experimental progress bar spans the complete run rather than restarting at individual block boundaries.&lt;br /&gt;
&lt;br /&gt;
There is no explicit success color or target-color change during feedback. The target disappears when acquired.&lt;br /&gt;
&lt;br /&gt;
==Diagnostic Window==&lt;br /&gt;
&lt;br /&gt;
A separate Qt diagnostic window titled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FEP Visuomotor Joystick Diagnostics&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is displayed to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During the experiment it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current stage.&lt;br /&gt;
* Original block number out of six.&lt;br /&gt;
* Overall trial number.&lt;br /&gt;
* Total number of active trials.&lt;br /&gt;
* Trial number within the current block.&lt;br /&gt;
* Current mapping: Normal or Inverted.&lt;br /&gt;
* Cursor-gain condition: Normal or High.&lt;br /&gt;
* Actual cursor gain.&lt;br /&gt;
* Whether the current trial followed a mapping switch.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Current task phase.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Raw BCI2000 joystick states.&lt;br /&gt;
* Converted joystick coordinates.&lt;br /&gt;
* Current cursor coordinates.&lt;br /&gt;
* Movement-started status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Reset/status information.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window does not currently display &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;, although that value is recorded as a BCI2000 state.&lt;br /&gt;
&lt;br /&gt;
During the introduction and sandbox, the window reports:&lt;br /&gt;
&lt;br /&gt;
* Current introduction stage.&lt;br /&gt;
* Block/trial as not yet started.&lt;br /&gt;
* Normal mapping.&lt;br /&gt;
* Normal 1.0 gain.&lt;br /&gt;
* No mapping switch.&lt;br /&gt;
* Counter value 0.&lt;br /&gt;
* No experimental target.&lt;br /&gt;
* Joystick coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Zero timing values.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Controls===&lt;br /&gt;
&lt;br /&gt;
The current diagnostic window provides:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESET CURRENT TRIAL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is no diagnostic introduction-continuation button.&lt;br /&gt;
&lt;br /&gt;
The reset control is enabled only during the experimental portion of the run before the Feedback phase.&lt;br /&gt;
&lt;br /&gt;
==Trial Reset==&lt;br /&gt;
&lt;br /&gt;
Experimental trials may be manually reset during:&lt;br /&gt;
&lt;br /&gt;
* Waiting for center.&lt;br /&gt;
* Holding center.&lt;br /&gt;
* Warning.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-visible movement.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during:&lt;br /&gt;
&lt;br /&gt;
* Feedback.&lt;br /&gt;
* Finished.&lt;br /&gt;
* Introduction.&lt;br /&gt;
* Sandbox.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to &amp;lt;code&amp;gt;WaitingForCenter&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Restarts the phase timer.&lt;br /&gt;
* Clears target-appearance timing.&lt;br /&gt;
* Clears movement-onset timing.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Clears &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Produces a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; pulse.&lt;br /&gt;
* Clears reaction-time state.&lt;br /&gt;
* Clears movement-time state.&lt;br /&gt;
* Clears total-time state.&lt;br /&gt;
* Resets movement-baseline accumulation.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Keeps the same mapping.&lt;br /&gt;
* Keeps the same gain.&lt;br /&gt;
* Keeps the same block number.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Keeps the same &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Does not rebuild or reshuffle the experimental sequence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; is cleared on the next processing block and should therefore be interpreted as a one-processing-block event.&lt;br /&gt;
&lt;br /&gt;
A reset does not generate a new &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; event.&lt;br /&gt;
&lt;br /&gt;
==Timing Measurements==&lt;br /&gt;
&lt;br /&gt;
Timing is measured using &amp;lt;code&amp;gt;std::chrono::steady_clock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Events are detected within BCI2000 &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt; calls, so effective event timing resolution is limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Movement Onset===&lt;br /&gt;
&lt;br /&gt;
The joystick baseline is initialized when center holding begins and updated during the center-hold phase.&lt;br /&gt;
&lt;br /&gt;
Movement onset occurs when either joystick axis differs from this baseline by more than 8 task-coordinate units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentX - baselineX) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
abs(currentY - baselineY) &amp;gt; 8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reaction Time===&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; detected movement onset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and recorded in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Movement Time===&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
detected movement onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and recorded in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Time===&lt;br /&gt;
&lt;br /&gt;
Total time is measured from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target onset -&amp;gt; target acquisition&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and recorded in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timing values are expressed as rounded milliseconds.&lt;br /&gt;
&lt;br /&gt;
The timing states:&lt;br /&gt;
&lt;br /&gt;
* Are populated when the target is acquired.&lt;br /&gt;
* Remain populated through the Feedback phase.&lt;br /&gt;
* Are cleared when advancing to an ordinary subsequent trial.&lt;br /&gt;
* Are cleared after a manual reset.&lt;br /&gt;
* Remain populated after completion of the final trial.&lt;br /&gt;
* Are zero during the introduction and sandbox.&lt;br /&gt;
&lt;br /&gt;
If target acquisition occurs without a detected movement onset, reaction time and movement time are written as zero while total time is still recorded.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Range&lt;br /&gt;
&lt;br /&gt;
| ! Meaning                                                           |&lt;br /&gt;
| ------------------------------------------------------------------- |&lt;br /&gt;
| &amp;lt;code&amp;gt;BaselineTrials&amp;lt;/code&amp;gt;                                         |&lt;br /&gt;
| Integer                                                             |&lt;br /&gt;
| 20                                                                  |&lt;br /&gt;
| 0-10000                                                             |&lt;br /&gt;
| Number of Normal trials in block 1.                                 |&lt;br /&gt;
| -                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;InitialInvertedTrials&amp;lt;/code&amp;gt;                                  |&lt;br /&gt;
| Integer                                                             |&lt;br /&gt;
| 5                                                                   |&lt;br /&gt;
| 0-10000                                                             |&lt;br /&gt;
| Number of Inverted trials in block 2.                               |&lt;br /&gt;
| -                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;ReturnNormalTrials&amp;lt;/code&amp;gt;                                     |&lt;br /&gt;
| Integer                                                             |&lt;br /&gt;
| 5                                                                   |&lt;br /&gt;
| 0-10000                                                             |&lt;br /&gt;
| Number of Normal trials in block 3.                                 |&lt;br /&gt;
| -                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;MixedTrials&amp;lt;/code&amp;gt;                                            |&lt;br /&gt;
| Integer                                                             |&lt;br /&gt;
| 20                                                                  |&lt;br /&gt;
| 0-10000                                                             |&lt;br /&gt;
| Number of approximately balanced Normal/Inverted trials in block 4. |&lt;br /&gt;
| -                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;StrongPriorTrials&amp;lt;/code&amp;gt;                                      |&lt;br /&gt;
| Integer                                                             |&lt;br /&gt;
| 20                                                                  |&lt;br /&gt;
| 0-10000                                                             |&lt;br /&gt;
| Number of predominantly Normal trials in block 5.                   |&lt;br /&gt;
| -                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;BalancedPriorTrials&amp;lt;/code&amp;gt;                                    |&lt;br /&gt;
| Integer                                                             |&lt;br /&gt;
| 20                                                                  |&lt;br /&gt;
| 0-10000                                                             |&lt;br /&gt;
| Number of approximately balanced trials in block 6.                 |&lt;br /&gt;
| }                                                                   |&lt;br /&gt;
&lt;br /&gt;
At least one trial must be configured across the six block parameters.&lt;br /&gt;
&lt;br /&gt;
===Cursor Gain===&lt;br /&gt;
&lt;br /&gt;
====HighCursorGain====&lt;br /&gt;
&lt;br /&gt;
Gain applied during High cursor-gain trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1.5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1.0-5.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normal gain is fixed at 1.0.&lt;br /&gt;
&lt;br /&gt;
===Trial Timing===&lt;br /&gt;
&lt;br /&gt;
====CenterHoldSeconds====&lt;br /&gt;
&lt;br /&gt;
Time the participant must remain within the center region.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
====WarningSeconds====&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
====PreTargetDelaySeconds====&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target onset.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
====FeedbackSeconds====&lt;br /&gt;
&lt;br /&gt;
Duration of the feedback phase after successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===Display===&lt;br /&gt;
&lt;br /&gt;
====StimulusDisplay====&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, available displays are enumerated by the application.&lt;br /&gt;
&lt;br /&gt;
===Parameters Not Defined by This Application===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;&lt;br /&gt;
* Initial mapping selector&lt;br /&gt;
* Mapping-switch probability&lt;br /&gt;
* Introduction enable/disable parameter&lt;br /&gt;
* Sandbox duration&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* Cursor-noise parameter&lt;br /&gt;
* &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt;&lt;br /&gt;
* CSV-output parameter&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Width&lt;br /&gt;
! Initial&lt;br /&gt;
! Produced values&lt;br /&gt;
&lt;br /&gt;
| ! Meaning                                                                  |&lt;br /&gt;
| -------------------------------------------------------------------------- |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt;                                                       |&lt;br /&gt;
| 10 bit                                                                     |&lt;br /&gt;
| 512                                                                        |&lt;br /&gt;
| 0-1023                                                                     |&lt;br /&gt;
| Participant-visible horizontal cursor coordinate.                          |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;                                                       |&lt;br /&gt;
| 10 bit                                                                     |&lt;br /&gt;
| 512                                                                        |&lt;br /&gt;
| 0-1023                                                                     |&lt;br /&gt;
| Participant-visible vertical cursor coordinate.                            |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;                                                     |&lt;br /&gt;
| 3 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-7                                                                        |&lt;br /&gt;
| Current introduction or experimental phase.                                |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;                                                 |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| 0 Normal, 1 Inverted.                                                      |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;                                                   |&lt;br /&gt;
| 12 bit                                                                     |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-3599                                                                     |&lt;br /&gt;
| Target angle in tenths of a degree.                                        |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt;                                                       |&lt;br /&gt;
| 10 bit                                                                     |&lt;br /&gt;
| 512                                                                        |&lt;br /&gt;
| Experimental target coordinate                                             |&lt;br /&gt;
| Horizontal target coordinate.                                              |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;                                                       |&lt;br /&gt;
| 10 bit                                                                     |&lt;br /&gt;
| 512                                                                        |&lt;br /&gt;
| Experimental target coordinate                                             |&lt;br /&gt;
| Vertical target coordinate.                                                |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;                                                     |&lt;br /&gt;
| 8 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-6                                                                        |&lt;br /&gt;
| Original experimental block-role number.                                   |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;                                                     |&lt;br /&gt;
| 16 bit                                                                     |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| One-based experimental trial                                               |&lt;br /&gt;
| Overall trial number across active blocks.                                 |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;                                               |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| Indicates detected movement onset.                                         |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;                                                     |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| One-processing-block target-acquisition event.                             |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;                                                    |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| One-processing-block manual-reset event.                                   |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;                                                 |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| One-processing-block mapping-change event.                                 |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;                                      |&lt;br /&gt;
| 16 bit                                                                     |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0 upward                                                                   |&lt;br /&gt;
| Number of consecutive no-switch transitions since the last mapping switch. |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;                                                |&lt;br /&gt;
| 2 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-3                                                                        |&lt;br /&gt;
| Current block-level prior category.                                        |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;                                           |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| 0 Normal gain, 1 High gain.                                                |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;                                                  |&lt;br /&gt;
| 1 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-1                                                                        |&lt;br /&gt;
| 1 during introduction or sandbox; 0 during experiment.                     |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt;                                                 |&lt;br /&gt;
| 4 bit                                                                      |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| 0-2                                                                        |&lt;br /&gt;
| 0 experiment, 1 introduction, 2 sandbox.                                   |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;                                                |&lt;br /&gt;
| 32 bit                                                                     |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| Nonnegative milliseconds                                                   |&lt;br /&gt;
| Target onset to detected movement onset.                                   |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;                                                |&lt;br /&gt;
| 32 bit                                                                     |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| Nonnegative milliseconds                                                   |&lt;br /&gt;
| Detected movement onset to target acquisition.                             |&lt;br /&gt;
| -                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;                                                   |&lt;br /&gt;
| 32 bit                                                                     |&lt;br /&gt;
| 0                                                                          |&lt;br /&gt;
| Nonnegative milliseconds                                                   |&lt;br /&gt;
| Target onset to target acquisition.                                        |&lt;br /&gt;
| }                                                                          |&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also reads states supplied by BCI2000&#039;s joystick logging system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
&lt;br /&gt;
| ! Description                                                            |&lt;br /&gt;
| ------------------------------------------------------------------------ |&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;                                                |&lt;br /&gt;
| Raw horizontal joystick position, normally ranging from 0 through 32767. |&lt;br /&gt;
| -                                                                        |&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;                                                |&lt;br /&gt;
| Raw vertical joystick position, normally ranging from 0 through 32767.   |&lt;br /&gt;
| -                                                                        |&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;                                            |&lt;br /&gt;
| Joystick button 1. Used to advance the introduction and sandbox.         |&lt;br /&gt;
| }                                                                        |&lt;br /&gt;
&lt;br /&gt;
The application also accesses the standard BCI2000:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
state when ending the experiment.&lt;br /&gt;
&lt;br /&gt;
===States Not Present===&lt;br /&gt;
&lt;br /&gt;
The current implementation does not define:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorX&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;DisplayedCursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SensoryReliability&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cursor Coordinates==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt; represent the final cursor coordinates actually displayed to the participant after any:&lt;br /&gt;
&lt;br /&gt;
* Mapping inversion.&lt;br /&gt;
* High-gain transformation.&lt;br /&gt;
* Return-to-anchor transformation.&lt;br /&gt;
* Display-boundary clipping.&lt;br /&gt;
&lt;br /&gt;
The same coordinates are used for:&lt;br /&gt;
&lt;br /&gt;
* Participant cursor rendering.&lt;br /&gt;
* Center detection.&lt;br /&gt;
* Target-hit detection.&lt;br /&gt;
* BCI2000 state output.&lt;br /&gt;
* Diagnostic display.&lt;br /&gt;
&lt;br /&gt;
They should therefore be used when analyzing the participant-visible cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
The task does not record a separate latent or untransformed cursor trajectory.&lt;br /&gt;
&lt;br /&gt;
The direct joystick-equivalent trajectory may be reconstructed offline from:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using the same conversion logic as the task.&lt;br /&gt;
&lt;br /&gt;
Raw joystick and displayed cursor coordinates match during:&lt;br /&gt;
&lt;br /&gt;
* The sandbox.&lt;br /&gt;
* Ordinary centering.&lt;br /&gt;
* Normal 1x trials.&lt;br /&gt;
* The instant a transformed movement anchor is captured.&lt;br /&gt;
&lt;br /&gt;
They diverge during:&lt;br /&gt;
&lt;br /&gt;
* Inverted movement.&lt;br /&gt;
* High-gain movement.&lt;br /&gt;
* Inverted plus high-gain movement.&lt;br /&gt;
* Return-to-anchor behavior following a transformed trial.&lt;br /&gt;
&lt;br /&gt;
==Data Recording==&lt;br /&gt;
&lt;br /&gt;
Task variables are recorded as BCI2000 states in the ordinary BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; data stream.&lt;br /&gt;
&lt;br /&gt;
The application records information sufficient to recover:&lt;br /&gt;
&lt;br /&gt;
* Participant-visible cursor trajectory.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Mapping condition.&lt;br /&gt;
* Cursor-gain condition.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Target coordinates.&lt;br /&gt;
* Block number.&lt;br /&gt;
* Trial number.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Trial resets.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Trials since the most recent mapping switch.&lt;br /&gt;
* Prior-condition category.&lt;br /&gt;
* Introduction/sandbox status.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
&lt;br /&gt;
Joystick trajectories are recorded through BCI2000 input logging when joystick logging is enabled.&lt;br /&gt;
&lt;br /&gt;
The application passes signal channels through unchanged:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Output = Input;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Secondary Output===&lt;br /&gt;
&lt;br /&gt;
The current FEP implementation does not write an application-specific:&lt;br /&gt;
&lt;br /&gt;
* CSV file.&lt;br /&gt;
* JSON file.&lt;br /&gt;
* Text results file.&lt;br /&gt;
* Database.&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
Successful trials generate diagnostic/log output, but this is not a structured secondary results file.&lt;br /&gt;
&lt;br /&gt;
==Offline Analysis Notes==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement / Event&lt;br /&gt;
&lt;br /&gt;
| ! Recommended identification                                                                       |&lt;br /&gt;
| -------------------------------------------------------------------------------------------------- |&lt;br /&gt;
| Experimental samples                                                                               |&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;                                                                     |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Introduction screen                                                                                |&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 1&amp;lt;/code&amp;gt;                                 |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Sandbox                                                                                            |&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TutorialPhase == 2&amp;lt;/code&amp;gt;                                 |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Active experimental trial                                                                          |&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; 1 through 6 |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Target onset                                                                                       |&lt;br /&gt;
| Transition into &amp;lt;code&amp;gt;TaskPhase == 5&amp;lt;/code&amp;gt;                                                        |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Movement onset                                                                                     |&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;                                                  |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Target acquisition                                                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt;                                                                        |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Normal mapping                                                                                     |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 0&amp;lt;/code&amp;gt;                                                                    |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Inverted mapping                                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition == 1&amp;lt;/code&amp;gt;                                                                    |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Normal cursor gain                                                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 0&amp;lt;/code&amp;gt;                                                              |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| High cursor gain                                                                                   |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition == 1&amp;lt;/code&amp;gt;                                                              |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Mapping switch                                                                                     |&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch == 1&amp;lt;/code&amp;gt;                                                                    |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| First trial after switch                                                                           |&lt;br /&gt;
| Trial receiving the &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt; event                                               |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Trials since switch                                                                                |&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;                                                              |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Previous mapping                                                                                   |&lt;br /&gt;
| Derive from the preceding trial&#039;s &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;                                       |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Prior category                                                                                     |&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;                                                                        |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Block                                                                                              |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;                                                                             |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Overall trial                                                                                      |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;                                                                             |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Target angle                                                                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle / 10&amp;lt;/code&amp;gt; degrees                                                              |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Target position                                                                                    |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;                                                      |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Raw joystick trajectory                                                                            |&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;                                            |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Participant-visible cursor trajectory                                                              |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;                                                      |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Reaction time                                                                                      |&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;, preferably sampled at target acquisition or during feedback           |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Movement time                                                                                      |&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;, preferably sampled at target acquisition or during feedback           |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Total time                                                                                         |&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;, preferably sampled at target acquisition or during feedback              |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Manual reset                                                                                       |&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt;                                                                       |&lt;br /&gt;
| -                                                                                                  |&lt;br /&gt;
| Experiment completion                                                                              |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskPhase == 7&amp;lt;/code&amp;gt;, followed by &amp;lt;code&amp;gt;Running == 0&amp;lt;/code&amp;gt;                                 |&lt;br /&gt;
| }                                                                                                  |&lt;br /&gt;
&lt;br /&gt;
===Event-Like and Persistent States===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
&lt;br /&gt;
| ! Behavior                                        |&lt;br /&gt;
| ------------------------------------------------- |&lt;br /&gt;
| &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;                        |&lt;br /&gt;
| One processing block                              |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt;                            |&lt;br /&gt;
| One processing block                              |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt;                           |&lt;br /&gt;
| One processing block                              |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;                      |&lt;br /&gt;
| Remains high from movement onset through feedback |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;             |&lt;br /&gt;
| Persistent counter                                |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;                        |&lt;br /&gt;
| Persistent for current trial                      |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;                  |&lt;br /&gt;
| Persistent for current trial                      |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;                       |&lt;br /&gt;
| Persistent for current block                      |&lt;br /&gt;
| -                                                 |&lt;br /&gt;
| Timing states                                     |&lt;br /&gt;
| Remain populated through feedback                 |&lt;br /&gt;
| }                                                 |&lt;br /&gt;
&lt;br /&gt;
An event state that lasts one BCI2000 processing block will ordinarily be represented across the samples belonging to that signal block rather than necessarily appearing as a single sample in the final data file.&lt;br /&gt;
&lt;br /&gt;
==Differences from USBHIDJoystickTask==&lt;br /&gt;
&lt;br /&gt;
The FEP task retains much of the center-out reaching and data-recording infrastructure of the earlier USBHIDJoystickTask while substantially changing the participant-facing experimental structure.&lt;br /&gt;
&lt;br /&gt;
===Retained===&lt;br /&gt;
&lt;br /&gt;
* BCI2000 &amp;lt;code&amp;gt;ApplicationBase&amp;lt;/code&amp;gt; application module.&lt;br /&gt;
* USB joystick input through BCI2000 input logging.&lt;br /&gt;
* Center-out reaching behavior.&lt;br /&gt;
* Center hold.&lt;br /&gt;
* Yellow warning period.&lt;br /&gt;
* Pre-target delay.&lt;br /&gt;
* Target-directed movement.&lt;br /&gt;
* Feedback interval.&lt;br /&gt;
* Continuous target-angle generation.&lt;br /&gt;
* Reaction-time measurement.&lt;br /&gt;
* Movement-time measurement.&lt;br /&gt;
* Total-time measurement.&lt;br /&gt;
* Movement-onset deadzone.&lt;br /&gt;
* Participant application window.&lt;br /&gt;
* Experimenter diagnostic window.&lt;br /&gt;
* Manual trial reset.&lt;br /&gt;
* Experimental progress bar.&lt;br /&gt;
* BCI2000 state logging.&lt;br /&gt;
* Direct and inverted joystick-control concepts.&lt;br /&gt;
&lt;br /&gt;
===Removed===&lt;br /&gt;
&lt;br /&gt;
The FEP task does not use the older task&#039;s:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Automatic-only mode.&lt;br /&gt;
* Controlled-only mode.&lt;br /&gt;
* Ordered-mode selector.&lt;br /&gt;
* Configurable ordered starting condition.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Green Automatic targets.&lt;br /&gt;
* Red Controlled targets.&lt;br /&gt;
* Condition-specific target-color cues.&lt;br /&gt;
* Detailed Automatic/Controlled tutorial.&lt;br /&gt;
* Explicit teaching of the inverted mapping.&lt;br /&gt;
* Condition-specific practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Optional tutorial enable/disable parameter.&lt;br /&gt;
* Diagnostic tutorial-continuation button.&lt;br /&gt;
* Condition-specific run-summary statistics.&lt;br /&gt;
* &amp;lt;code&amp;gt;ResultsFile&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Secondary CSV output.&lt;br /&gt;
* Participant-facing block announcements.&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
&lt;br /&gt;
The FEP task adds:&lt;br /&gt;
&lt;br /&gt;
* Fixed six-role experimental sequence.&lt;br /&gt;
* Hidden Normal and Inverted mappings.&lt;br /&gt;
* &amp;lt;code&amp;gt;MappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialsSinceMappingSwitch&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;CursorGainCondition&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;HighCursorGain&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Normal versus high-gain trials.&lt;br /&gt;
* Hidden mapping switches.&lt;br /&gt;
* Minimal participant introduction.&lt;br /&gt;
* Free-movement sandbox.&lt;br /&gt;
* Black targets in all conditions.&lt;br /&gt;
* Approximately balanced and Normal-dominant mapping blocks.&lt;br /&gt;
&lt;br /&gt;
===Changed Condition Terminology===&lt;br /&gt;
&lt;br /&gt;
The earlier USB task used:&lt;br /&gt;
&lt;br /&gt;
* Automatic&lt;br /&gt;
* Controlled&lt;br /&gt;
&lt;br /&gt;
The FEP task uses:&lt;br /&gt;
&lt;br /&gt;
* Normal&lt;br /&gt;
* Inverted&lt;br /&gt;
&lt;br /&gt;
===Changed Trial Organization===&lt;br /&gt;
&lt;br /&gt;
The USB task supports selectable experimental modes and explicit ordered or pseudorandom block structures.&lt;br /&gt;
&lt;br /&gt;
The FEP task instead constructs a predefined six-role sequence and omits individual blocks only when their configured trial count is zero.&lt;br /&gt;
&lt;br /&gt;
===Changed Participant Information===&lt;br /&gt;
&lt;br /&gt;
The earlier task explicitly explains its mappings and provides condition-specific practice.&lt;br /&gt;
&lt;br /&gt;
The FEP task deliberately provides only generic joystick instructions and a Normal-mapping sandbox.&lt;br /&gt;
&lt;br /&gt;
It does not disclose:&lt;br /&gt;
&lt;br /&gt;
* Inversion.&lt;br /&gt;
* Gain manipulation.&lt;br /&gt;
* Mapping switches.&lt;br /&gt;
* Mapping probabilities.&lt;br /&gt;
* Block transitions.&lt;br /&gt;
&lt;br /&gt;
==Known Limitations and Analysis Considerations==&lt;br /&gt;
&lt;br /&gt;
* The FEP module currently has no independent source-control revision.&lt;br /&gt;
* There is no task-specific saved parameter file in the inspected source tree.&lt;br /&gt;
* There is no task-specific launch batch file in the inspected source tree.&lt;br /&gt;
* The participant&#039;s subjective expectation or surprise cannot be inferred directly from the software.&lt;br /&gt;
* &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; describes block context rather than an inferred participant belief.&lt;br /&gt;
* Blocks 4 and 6 use the same approximately balanced mapping-generation rule and differ principally in their sequence position and &amp;lt;code&amp;gt;PriorCondition&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* The mapping pseudorandomization restrictions are not guaranteed if all 64 candidate shuffles fail.&lt;br /&gt;
* There is no unsuccessful-trial timeout.&lt;br /&gt;
* The source contains no explicit formal Free Energy Principle model.&lt;br /&gt;
* High cursor gain is implemented as a gain manipulation. The source itself does not label it sensory reliability.&lt;br /&gt;
* There is no separately recorded untransformed cursor trajectory.&lt;br /&gt;
* Analyses requiring the direct joystick-equivalent trajectory should reconstruct it from joystick states.&lt;br /&gt;
* Display geometry is normalized from a nominal 1000 x 750 design and physical appearance may depend on monitor geometry and BCI2000 window configuration.&lt;br /&gt;
&lt;br /&gt;
==Scientific References==&lt;br /&gt;
&lt;br /&gt;
No FEP-specific paper, DOI, PMID, arXiv identifier, or other scientific reference is currently cited in the &amp;lt;code&amp;gt;FEP_VisuomotorJoystickTask&amp;lt;/code&amp;gt; source code or supporting files inspected for this documentation.&lt;br /&gt;
&lt;br /&gt;
The current implementation should therefore be described in terms of its implemented experimental manipulations rather than attributed to a specific formal Free Energy Principle model unless an appropriate study protocol or scientific reference is added separately.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12581</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12581"/>
		<updated>2026-09-08T14:56:13Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Video Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each experimental trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task also includes an optional participant introduction and practice sequence. Before the experiment begins, participants may receive task instructions, explore both normal and reversed cursor mappings, and complete automatic and controlled practice trials. Tutorial and practice periods are recorded in the BCI2000 data stream but remain separate from experimental trial numbering and experimental performance summaries.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&lt;br /&gt;
The following video demonstrates the Visuomotor Joystick Task running in BCI2000, including the participant display and joystick-controlled task behavior: &amp;lt;youtube alignment=&amp;quot;center&amp;quot;&amp;gt;https://www.youtube.com/watch?v=LSZW3nxg3Vg&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This video displays version 1 of the task, and as such does not include the pre-experiment participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* An optional participant tutorial and practice sequence.&lt;br /&gt;
* Automatic and controlled practice trials.&lt;br /&gt;
* Free-movement demonstrations of normal and reversed cursor control.&lt;br /&gt;
* Joystick-button and experimenter-controlled tutorial progression.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, tutorial status, practice trials, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information, tutorial controls, and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
* Separation of tutorial/practice data from experimental trial numbering, experimental CSV output, and run-summary metrics.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default experimental center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates experimental targets over a continuous range of angles rather than restricting targets to eight positions. It also provides an optional tutorial and practice sequence and records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
When the tutorial is enabled, its content depends on &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Experiment mode&lt;br /&gt;
! Tutorial content&lt;br /&gt;
|-&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| General introduction, normal free movement, automatic instructions, automatic practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| General introduction, normal free movement, controlled instructions, controlled free movement, controlled practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Ordered&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|-&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When both conditions are present, the tutorial always presents automatic training before controlled training. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; affects the experimental block order but does not change the tutorial order.&lt;br /&gt;
&lt;br /&gt;
===Tutorial and Practice Sequence===&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, the tutorial begins at the start of each run before the first experimental block.&lt;br /&gt;
&lt;br /&gt;
The tutorial consists of the following stages:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! TutorialPhase&lt;br /&gt;
! Stage&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| None&lt;br /&gt;
| Tutorial inactive; normal experiment operation&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Introduction&lt;br /&gt;
| General explanation of the task and upcoming conditions&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Normal free movement&lt;br /&gt;
| Participant explores normal direct joystick-to-cursor movement&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Automatic instructions&lt;br /&gt;
| Explanation of the automatic condition and green targets&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Automatic practice&lt;br /&gt;
| Automatic practice trials using the normal mapping&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Controlled instructions&lt;br /&gt;
| Explanation of the controlled condition and red targets&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Controlled free movement&lt;br /&gt;
| Participant explores continuous reversed joystick-to-cursor control&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Controlled practice&lt;br /&gt;
| Controlled practice trials using the inverted mapping&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Complete&lt;br /&gt;
| Practice-complete summary before the experiment begins&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=0&amp;lt;/code&amp;gt;, the tutorial is skipped and the task begins with the original experimental block-announcement sequence.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Continuation===&lt;br /&gt;
&lt;br /&gt;
Tutorial screens that require participant acknowledgement may be advanced using either:&lt;br /&gt;
&lt;br /&gt;
* Joystick button 1, or&lt;br /&gt;
* The experimenter&#039;s &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
Joystick continuation uses rising-edge detection. Pressing the button advances one eligible tutorial screen, while holding the button does not repeatedly advance the tutorial. The button must be released and pressed again to produce another continuation event.&lt;br /&gt;
&lt;br /&gt;
Button presses are ignored during active practice trials and during tutorial transitions that require the participant to return the joystick or cursor to center.&lt;br /&gt;
&lt;br /&gt;
During the experimental portion of the run, joystick button presses do not control trial progression.&lt;br /&gt;
&lt;br /&gt;
===Normal Free Movement===&lt;br /&gt;
&lt;br /&gt;
During the normal free-movement stage, the participant may freely move the cursor using the direct absolute joystick mapping.&lt;br /&gt;
&lt;br /&gt;
There is no timer or trial progression during this stage. It continues until the participant presses the joystick button or the experimenter selects &#039;&#039;&#039;CONTINUE&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Automatic Practice===&lt;br /&gt;
&lt;br /&gt;
Automatic practice uses the same direct mapping and the same basic trial phases as experimental automatic trials:&lt;br /&gt;
&lt;br /&gt;
# Waiting for center&lt;br /&gt;
# Holding center&lt;br /&gt;
# Warning&lt;br /&gt;
# Pre-target delay&lt;br /&gt;
# Target visible&lt;br /&gt;
# Feedback&lt;br /&gt;
&lt;br /&gt;
Practice trials differ from experimental trials in several ways:&lt;br /&gt;
&lt;br /&gt;
* Center hold is determined by &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Practice targets follow a deterministic sequence.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; remain 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; identifies the active practice trial.&lt;br /&gt;
* No trial row is written to the secondary CSV file.&lt;br /&gt;
* Practice results are excluded from experimental completion counts and timing summaries.&lt;br /&gt;
* Practice reset attempts do not increment experimental reset metrics.&lt;br /&gt;
&lt;br /&gt;
After the final automatic practice trial, the participant must return the cursor to the center before the tutorial advances.&lt;br /&gt;
&lt;br /&gt;
===Controlled Free Movement===&lt;br /&gt;
&lt;br /&gt;
The controlled free-movement stage allows the participant to explore reversed cursor control without a target.&lt;br /&gt;
&lt;br /&gt;
The participant is first asked to return the cursor to center. Once centered, the application records the current joystick and cursor positions as anchors and enables the same relative inverted mapping used during target-directed controlled movement.&lt;br /&gt;
&lt;br /&gt;
When the participant requests continuation, the task requires the joystick to return to the anchored position before advancing. This prevents an abrupt cursor jump when the mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Controlled Practice===&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses the same basic controlled-trial behavior as the experiment:&lt;br /&gt;
&lt;br /&gt;
* Direct absolute mapping is used during centering.&lt;br /&gt;
* Joystick and cursor anchors are recorded when the target appears.&lt;br /&gt;
* Target-directed cursor movement uses the relative inverted mapping.&lt;br /&gt;
* The participant returns the joystick toward its anchor after target acquisition.&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; and deterministic practice targets and remains separate from experimental numbering, CSV output, and performance summaries.&lt;br /&gt;
&lt;br /&gt;
After the final controlled practice trial, the participant must complete the return-to-center and return-to-anchor transition before the completion screen appears.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Completion===&lt;br /&gt;
&lt;br /&gt;
The completion screen summarizes the condition mappings:&lt;br /&gt;
&lt;br /&gt;
* Automatic: cursor movement follows joystick movement.&lt;br /&gt;
* Controlled: cursor movement is opposite joystick movement.&lt;br /&gt;
* Green targets identify automatic trials.&lt;br /&gt;
* Red targets identify controlled trials.&lt;br /&gt;
&lt;br /&gt;
After continuation, the tutorial ends, &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; returns to 0, the originally generated first experimental target is restored, and the experiment begins with the normal 1.5-second block announcement.&lt;br /&gt;
&lt;br /&gt;
===Experimental Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each experimental block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new experimental trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is used during the tutorial as a participant continuation button. A rising button press may advance eligible tutorial screens. It does not advance active practice trials and has no effect on experimental trial progression.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Experimental Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows experimental targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Practice Target Generation===&lt;br /&gt;
&lt;br /&gt;
Practice trials use a deterministic six-angle sequence rather than the experimental random target generator:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sequence value&lt;br /&gt;
! Target angle&lt;br /&gt;
|-&lt;br /&gt;
| 150&lt;br /&gt;
| 15 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 450&lt;br /&gt;
| 45 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 750&lt;br /&gt;
| 75 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1050&lt;br /&gt;
| 105 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1350&lt;br /&gt;
| 135 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1650&lt;br /&gt;
| 165 degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Automatic practice begins with the 15-degree target and follows the sequence in order.&lt;br /&gt;
&lt;br /&gt;
Controlled practice begins with an offset of two positions, producing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
75°, 105°, 135°, 165°, 15°, 45°&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If more than six practice trials are configured, the sequence repeats.&lt;br /&gt;
&lt;br /&gt;
These targets are positioned in the lower half of the participant display to reduce overlap with tutorial text.&lt;br /&gt;
&lt;br /&gt;
The random target generated for the first experimental trial is saved before the tutorial begins and restored after practice finishes.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current trial phase is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement / no active practice trial&lt;br /&gt;
| During the experiment, the upcoming block type is being displayed. During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is also 0.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During active automatic or controlled practice trials, values 1 through 6 retain the same meanings as they do during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Because non-trial tutorial screens use &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;, analysts should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish tutorial screens from experimental block announcements.&lt;br /&gt;
&lt;br /&gt;
An experimental target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A practice target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 1&lt;br /&gt;
and PracticeTrial &amp;gt; 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; reflects the tutorial condition rather than the first experimental condition. It begins at 0 during the general introduction and normal free-movement stages, including in Controlled Only mode, and changes to 1 once the controlled portion of the tutorial begins.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; is forced to 0 and should not be interpreted as an experimental ordered-automatic block.&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display during the experiment.&lt;br /&gt;
* Tutorial and practice instructions when the introduction is enabled.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all experimental trials are complete.&lt;br /&gt;
&lt;br /&gt;
The experimental progress bar is hidden throughout the tutorial and practice sequence. Practice trials do not contribute to experimental progress.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Tutorial mode.&lt;br /&gt;
* Numeric and textual tutorial phase.&lt;br /&gt;
* Tutorial condition.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
* Experimental trial as not yet started.&lt;br /&gt;
* Joystick coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state.&lt;br /&gt;
* Tutorial status.&lt;br /&gt;
&lt;br /&gt;
During the experiment, it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window contains a blue &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button for tutorial screens that require continuation.&lt;br /&gt;
&lt;br /&gt;
It also contains a reset button whose function changes according to task context:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RESET PRACTICE TRIAL&#039;&#039;&#039; during eligible practice trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET CURRENT TRIAL&#039;&#039;&#039; during eligible experimental trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET UNAVAILABLE&#039;&#039;&#039; when reset is not permitted.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
Experimental trials may be manually reset before they reach the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting an experimental trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the experimental diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
Practice trials may also be reset before feedback.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the practice trial to the waiting-for-center phase.&lt;br /&gt;
* Clears movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Keeps the same &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* Keeps the same deterministic target.&lt;br /&gt;
* Does not increment experimental reset metrics.&lt;br /&gt;
* Does not write a CSV row.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during tutorial instruction/free-movement screens and after a trial has entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for successfully completed practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
Practice timing values are recorded in the BCI2000 states but are excluded from experimental timing summaries and the secondary CSV output.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral and tutorial variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
Tutorial and practice samples are part of the same BCI2000 run as the experiment. The &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state should therefore be used when separating tutorial/practice data from experimental data during offline analysis.&lt;br /&gt;
&lt;br /&gt;
Practice trials record:&lt;br /&gt;
&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Target coordinates and angle.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Practice condition.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Practice reset events.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
&lt;br /&gt;
Practice trials are intentionally excluded from:&lt;br /&gt;
&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Secondary CSV rows.&lt;br /&gt;
* Automatic and controlled completion counts.&lt;br /&gt;
* Automatic and controlled reset counts.&lt;br /&gt;
* Mean reaction-time summaries.&lt;br /&gt;
* Mean movement-time summaries.&lt;br /&gt;
* Mean total-time summaries.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed experimental trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials and practice trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===EnableIntroduction===&lt;br /&gt;
&lt;br /&gt;
Enables or disables the participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
Type: integer boolean&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Skip the tutorial and begin the experiment normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Run the tutorial and practice sequence before the experiment.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to all experiment modes.&lt;br /&gt;
&lt;br /&gt;
===AutomaticPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains automatic trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips automatic practice trials while retaining the automatic instruction page.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===ControlledPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains controlled trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips controlled practice trials. The controlled instruction page and controlled free-movement demonstration are still presented.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===PracticeCenterHoldTime===&lt;br /&gt;
&lt;br /&gt;
Center-hold duration used during automatic and controlled practice trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating-point time&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0s-60s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This parameter replaces &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt; during practice trials only.&lt;br /&gt;
&lt;br /&gt;
Experimental trials continue to use &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
The selected mode also determines which condition-specific tutorial sections are presented when &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic experimental trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled experimental trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which experimental condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
It also does not affect tutorial order. When both conditions are included, the tutorial always presents automatic training before controlled training.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter does not control practice center-hold duration. Practice trials use &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial, tutorial transition, or experimental block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary experimental trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
Only successful experimental trials are written to this file. Practice trials are not written to the CSV.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether the participant tutorial/practice sequence is active.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive or disabled; experimental data&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Tutorial or practice sequence active&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, this state becomes 1 at the beginning of the run and returns to 0 when the tutorial completes and the experiment begins.&lt;br /&gt;
&lt;br /&gt;
This is the primary state for separating tutorial/practice samples from experimental samples during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TutorialPhase===&lt;br /&gt;
&lt;br /&gt;
4-bit state indicating the current stage of the tutorial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: General introduction&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Normal free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Automatic instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Automatic practice&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Controlled instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Controlled free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Controlled practice&lt;br /&gt;
* &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;: Practice complete&lt;br /&gt;
&lt;br /&gt;
After the final automatic or controlled practice feedback interval, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; may remain 4 or 7 while &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; has returned to 0 and the task waits for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Outside the tutorial, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
===PracticeTrial===&lt;br /&gt;
&lt;br /&gt;
8-bit state identifying the active practice trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: No active practice trial&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: One-based practice trial number within the current practice condition&lt;br /&gt;
&lt;br /&gt;
The state remains nonzero through the practice trial&#039;s feedback phase.&lt;br /&gt;
&lt;br /&gt;
After the final practice feedback interval it returns to 0 while the tutorial may still wait for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial does not increment &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current trial phase.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Experimental block announcement or non-trial tutorial screen&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
During active practice trials, values 1 through 6 have the same meanings as during experimental trials.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is forced to 0. Therefore, &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; alone no longer uniquely identifies an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
Use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0 and TaskPhase == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to identify an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
During active practice trials, this state identifies the practice condition.&lt;br /&gt;
&lt;br /&gt;
During the general introduction and normal free-movement tutorial stages, it initially reports 0 even when the configured experiment is Controlled Only.&lt;br /&gt;
&lt;br /&gt;
During the experiment it retains its original meaning.&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current experimental block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
During the tutorial, this state is forced to 0. It should therefore only be interpreted as an experimental block type when &amp;lt;code&amp;gt;Introduction=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During experimental trials, generated values range from &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During practice trials, the state contains the deterministic practice-target angle.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is set to 0.&lt;br /&gt;
&lt;br /&gt;
After tutorial completion, the saved first experimental target is restored.&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, target states are suppressed.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, target states are suppressed.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based experimental block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental block begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental block numbers.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall experimental trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental trial begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across experimental block boundaries. Manually resetting an experimental trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental trial numbers.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current active practice or experimental trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 identifies movement onset.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is forced to 0.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish practice movement onset from experimental movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches a practice or experimental target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
Experimental acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets a practice or experimental trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
Experimental reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. During the tutorial, a rising press may advance eligible instruction or free-movement screens. It does not advance active practice trials and does not control experimental progression.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
Because the tutorial and practice sequence are recorded within the same BCI2000 run as the experiment, analyses should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish experimental data from tutorial and practice data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! Recommended identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Tutorial/practice samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block announcement&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Non-trial tutorial screen&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, typically with &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;, interpreted together with &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
Analyses written for earlier versions of the task should be updated before use with tutorial-enabled data. In particular:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; no longer always identifies an experimental block announcement.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt; may indicate a practice or experimental success.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt; may indicate a practice or experimental reset.&lt;br /&gt;
* Nonzero timing states may belong to practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; should not be interpreted as experimental condition/block variables while &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12580</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12580"/>
		<updated>2026-09-08T14:54:56Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each experimental trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task also includes an optional participant introduction and practice sequence. Before the experiment begins, participants may receive task instructions, explore both normal and reversed cursor mappings, and complete automatic and controlled practice trials. Tutorial and practice periods are recorded in the BCI2000 data stream but remain separate from experimental trial numbering and experimental performance summaries.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&lt;br /&gt;
The following video demonstrates the Visuomotor Joystick Task running in BCI2000, including the participant display and joystick-controlled task behavior: &amp;lt;youtube alignment=&amp;quot;center&amp;quot;&amp;gt;https://www.youtube.com/watch?v=LSZW3nxg3Vg&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* An optional participant tutorial and practice sequence.&lt;br /&gt;
* Automatic and controlled practice trials.&lt;br /&gt;
* Free-movement demonstrations of normal and reversed cursor control.&lt;br /&gt;
* Joystick-button and experimenter-controlled tutorial progression.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, tutorial status, practice trials, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information, tutorial controls, and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
* Separation of tutorial/practice data from experimental trial numbering, experimental CSV output, and run-summary metrics.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default experimental center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates experimental targets over a continuous range of angles rather than restricting targets to eight positions. It also provides an optional tutorial and practice sequence and records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
When the tutorial is enabled, its content depends on &amp;lt;code&amp;gt;ExperimentMode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Experiment mode&lt;br /&gt;
! Tutorial content&lt;br /&gt;
|-&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| General introduction, normal free movement, automatic instructions, automatic practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| General introduction, normal free movement, controlled instructions, controlled free movement, controlled practice, completion&lt;br /&gt;
|-&lt;br /&gt;
| Ordered&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|-&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Automatic tutorial and practice followed by controlled tutorial and practice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When both conditions are present, the tutorial always presents automatic training before controlled training. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; affects the experimental block order but does not change the tutorial order.&lt;br /&gt;
&lt;br /&gt;
===Tutorial and Practice Sequence===&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, the tutorial begins at the start of each run before the first experimental block.&lt;br /&gt;
&lt;br /&gt;
The tutorial consists of the following stages:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! TutorialPhase&lt;br /&gt;
! Stage&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| None&lt;br /&gt;
| Tutorial inactive; normal experiment operation&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Introduction&lt;br /&gt;
| General explanation of the task and upcoming conditions&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Normal free movement&lt;br /&gt;
| Participant explores normal direct joystick-to-cursor movement&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Automatic instructions&lt;br /&gt;
| Explanation of the automatic condition and green targets&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Automatic practice&lt;br /&gt;
| Automatic practice trials using the normal mapping&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Controlled instructions&lt;br /&gt;
| Explanation of the controlled condition and red targets&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Controlled free movement&lt;br /&gt;
| Participant explores continuous reversed joystick-to-cursor control&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Controlled practice&lt;br /&gt;
| Controlled practice trials using the inverted mapping&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Complete&lt;br /&gt;
| Practice-complete summary before the experiment begins&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=0&amp;lt;/code&amp;gt;, the tutorial is skipped and the task begins with the original experimental block-announcement sequence.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Continuation===&lt;br /&gt;
&lt;br /&gt;
Tutorial screens that require participant acknowledgement may be advanced using either:&lt;br /&gt;
&lt;br /&gt;
* Joystick button 1, or&lt;br /&gt;
* The experimenter&#039;s &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button in the diagnostic window.&lt;br /&gt;
&lt;br /&gt;
Joystick continuation uses rising-edge detection. Pressing the button advances one eligible tutorial screen, while holding the button does not repeatedly advance the tutorial. The button must be released and pressed again to produce another continuation event.&lt;br /&gt;
&lt;br /&gt;
Button presses are ignored during active practice trials and during tutorial transitions that require the participant to return the joystick or cursor to center.&lt;br /&gt;
&lt;br /&gt;
During the experimental portion of the run, joystick button presses do not control trial progression.&lt;br /&gt;
&lt;br /&gt;
===Normal Free Movement===&lt;br /&gt;
&lt;br /&gt;
During the normal free-movement stage, the participant may freely move the cursor using the direct absolute joystick mapping.&lt;br /&gt;
&lt;br /&gt;
There is no timer or trial progression during this stage. It continues until the participant presses the joystick button or the experimenter selects &#039;&#039;&#039;CONTINUE&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Automatic Practice===&lt;br /&gt;
&lt;br /&gt;
Automatic practice uses the same direct mapping and the same basic trial phases as experimental automatic trials:&lt;br /&gt;
&lt;br /&gt;
# Waiting for center&lt;br /&gt;
# Holding center&lt;br /&gt;
# Warning&lt;br /&gt;
# Pre-target delay&lt;br /&gt;
# Target visible&lt;br /&gt;
# Feedback&lt;br /&gt;
&lt;br /&gt;
Practice trials differ from experimental trials in several ways:&lt;br /&gt;
&lt;br /&gt;
* Center hold is determined by &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Practice targets follow a deterministic sequence.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; remain 0.&lt;br /&gt;
* &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; identifies the active practice trial.&lt;br /&gt;
* No trial row is written to the secondary CSV file.&lt;br /&gt;
* Practice results are excluded from experimental completion counts and timing summaries.&lt;br /&gt;
* Practice reset attempts do not increment experimental reset metrics.&lt;br /&gt;
&lt;br /&gt;
After the final automatic practice trial, the participant must return the cursor to the center before the tutorial advances.&lt;br /&gt;
&lt;br /&gt;
===Controlled Free Movement===&lt;br /&gt;
&lt;br /&gt;
The controlled free-movement stage allows the participant to explore reversed cursor control without a target.&lt;br /&gt;
&lt;br /&gt;
The participant is first asked to return the cursor to center. Once centered, the application records the current joystick and cursor positions as anchors and enables the same relative inverted mapping used during target-directed controlled movement.&lt;br /&gt;
&lt;br /&gt;
When the participant requests continuation, the task requires the joystick to return to the anchored position before advancing. This prevents an abrupt cursor jump when the mapping changes.&lt;br /&gt;
&lt;br /&gt;
===Controlled Practice===&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses the same basic controlled-trial behavior as the experiment:&lt;br /&gt;
&lt;br /&gt;
* Direct absolute mapping is used during centering.&lt;br /&gt;
* Joystick and cursor anchors are recorded when the target appears.&lt;br /&gt;
* Target-directed cursor movement uses the relative inverted mapping.&lt;br /&gt;
* The participant returns the joystick toward its anchor after target acquisition.&lt;br /&gt;
&lt;br /&gt;
Controlled practice uses &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt; and deterministic practice targets and remains separate from experimental numbering, CSV output, and performance summaries.&lt;br /&gt;
&lt;br /&gt;
After the final controlled practice trial, the participant must complete the return-to-center and return-to-anchor transition before the completion screen appears.&lt;br /&gt;
&lt;br /&gt;
===Tutorial Completion===&lt;br /&gt;
&lt;br /&gt;
The completion screen summarizes the condition mappings:&lt;br /&gt;
&lt;br /&gt;
* Automatic: cursor movement follows joystick movement.&lt;br /&gt;
* Controlled: cursor movement is opposite joystick movement.&lt;br /&gt;
* Green targets identify automatic trials.&lt;br /&gt;
* Red targets identify controlled trials.&lt;br /&gt;
&lt;br /&gt;
After continuation, the tutorial ends, &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; returns to 0, the originally generated first experimental target is restored, and the experiment begins with the normal 1.5-second block announcement.&lt;br /&gt;
&lt;br /&gt;
===Experimental Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each experimental block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new experimental trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is used during the tutorial as a participant continuation button. A rising button press may advance eligible tutorial screens. It does not advance active practice trials and has no effect on experimental trial progression.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Experimental Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new experimental trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows experimental targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Practice Target Generation===&lt;br /&gt;
&lt;br /&gt;
Practice trials use a deterministic six-angle sequence rather than the experimental random target generator:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sequence value&lt;br /&gt;
! Target angle&lt;br /&gt;
|-&lt;br /&gt;
| 150&lt;br /&gt;
| 15 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 450&lt;br /&gt;
| 45 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 750&lt;br /&gt;
| 75 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1050&lt;br /&gt;
| 105 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1350&lt;br /&gt;
| 135 degrees&lt;br /&gt;
|-&lt;br /&gt;
| 1650&lt;br /&gt;
| 165 degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Automatic practice begins with the 15-degree target and follows the sequence in order.&lt;br /&gt;
&lt;br /&gt;
Controlled practice begins with an offset of two positions, producing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
75°, 105°, 135°, 165°, 15°, 45°&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If more than six practice trials are configured, the sequence repeats.&lt;br /&gt;
&lt;br /&gt;
These targets are positioned in the lower half of the participant display to reduce overlap with tutorial text.&lt;br /&gt;
&lt;br /&gt;
The random target generated for the first experimental trial is saved before the tutorial begins and restored after practice finishes.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current trial phase is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement / no active practice trial&lt;br /&gt;
| During the experiment, the upcoming block type is being displayed. During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is also 0.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During active automatic or controlled practice trials, values 1 through 6 retain the same meanings as they do during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Because non-trial tutorial screens use &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt;, analysts should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish tutorial screens from experimental block announcements.&lt;br /&gt;
&lt;br /&gt;
An experimental target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A practice target onset is identified by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 1&lt;br /&gt;
and PracticeTrial &amp;gt; 0&lt;br /&gt;
and TaskPhase transitions from 4 to 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; reflects the tutorial condition rather than the first experimental condition. It begins at 0 during the general introduction and normal free-movement stages, including in Controlled Only mode, and changes to 1 once the controlled portion of the tutorial begins.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; is forced to 0 and should not be interpreted as an experimental ordered-automatic block.&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display during the experiment.&lt;br /&gt;
* Tutorial and practice instructions when the introduction is enabled.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all experimental trials are complete.&lt;br /&gt;
&lt;br /&gt;
The experimental progress bar is hidden throughout the tutorial and practice sequence. Practice trials do not contribute to experimental progress.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter.&lt;br /&gt;
&lt;br /&gt;
During the tutorial, it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Tutorial mode.&lt;br /&gt;
* Numeric and textual tutorial phase.&lt;br /&gt;
* Tutorial condition.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
* Experimental trial as not yet started.&lt;br /&gt;
* Joystick coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Target angle.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state.&lt;br /&gt;
* Tutorial status.&lt;br /&gt;
&lt;br /&gt;
During the experiment, it displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window contains a blue &#039;&#039;&#039;CONTINUE&#039;&#039;&#039; button for tutorial screens that require continuation.&lt;br /&gt;
&lt;br /&gt;
It also contains a reset button whose function changes according to task context:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RESET PRACTICE TRIAL&#039;&#039;&#039; during eligible practice trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET CURRENT TRIAL&#039;&#039;&#039; during eligible experimental trials.&lt;br /&gt;
* &#039;&#039;&#039;RESET UNAVAILABLE&#039;&#039;&#039; when reset is not permitted.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
Experimental trials may be manually reset before they reach the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting an experimental trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the experimental diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
Practice trials may also be reset before feedback.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the practice trial to the waiting-for-center phase.&lt;br /&gt;
* Clears movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Keeps the same &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* Keeps the same deterministic target.&lt;br /&gt;
* Does not increment experimental reset metrics.&lt;br /&gt;
* Does not write a CSV row.&lt;br /&gt;
&lt;br /&gt;
Reset is unavailable during tutorial instruction/free-movement screens and after a trial has entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for successfully completed practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
Practice timing values are recorded in the BCI2000 states but are excluded from experimental timing summaries and the secondary CSV output.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral and tutorial variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
Tutorial and practice samples are part of the same BCI2000 run as the experiment. The &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; state should therefore be used when separating tutorial/practice data from experimental data during offline analysis.&lt;br /&gt;
&lt;br /&gt;
Practice trials record:&lt;br /&gt;
&lt;br /&gt;
* Cursor trajectory.&lt;br /&gt;
* Target coordinates and angle.&lt;br /&gt;
* Trial phase.&lt;br /&gt;
* Practice condition.&lt;br /&gt;
* Movement onset.&lt;br /&gt;
* Target acquisition.&lt;br /&gt;
* Reaction time.&lt;br /&gt;
* Movement time.&lt;br /&gt;
* Total time.&lt;br /&gt;
* Practice reset events.&lt;br /&gt;
* Practice trial number.&lt;br /&gt;
&lt;br /&gt;
Practice trials are intentionally excluded from:&lt;br /&gt;
&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Experimental &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt; numbering.&lt;br /&gt;
* Secondary CSV rows.&lt;br /&gt;
* Automatic and controlled completion counts.&lt;br /&gt;
* Automatic and controlled reset counts.&lt;br /&gt;
* Mean reaction-time summaries.&lt;br /&gt;
* Mean movement-time summaries.&lt;br /&gt;
* Mean total-time summaries.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed experimental trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials and practice trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===EnableIntroduction===&lt;br /&gt;
&lt;br /&gt;
Enables or disables the participant tutorial and practice sequence.&lt;br /&gt;
&lt;br /&gt;
Type: integer boolean&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Skip the tutorial and begin the experiment normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Run the tutorial and practice sequence before the experiment.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to all experiment modes.&lt;br /&gt;
&lt;br /&gt;
===AutomaticPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains automatic trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips automatic practice trials while retaining the automatic instruction page.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===ControlledPracticeTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled practice trials presented during the tutorial.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0-20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameter is used only when the selected experiment mode contains controlled trials.&lt;br /&gt;
&lt;br /&gt;
A value of 0 skips controlled practice trials. The controlled instruction page and controlled free-movement demonstration are still presented.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not count toward the experimental trial-count parameters.&lt;br /&gt;
&lt;br /&gt;
===PracticeCenterHoldTime===&lt;br /&gt;
&lt;br /&gt;
Center-hold duration used during automatic and controlled practice trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating-point time&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0s-60s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This parameter replaces &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt; during practice trials only.&lt;br /&gt;
&lt;br /&gt;
Experimental trials continue to use &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
The selected mode also determines which condition-specific tutorial sections are presented when &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic experimental trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled experimental trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
Practice trials are additional and do not reduce or increment this count.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which experimental condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
It also does not affect tutorial order. When both conditions are included, the tutorial always presents automatic training before controlled training.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of experimental controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region during experimental trials.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter does not control practice center-hold duration. Practice trials use &amp;lt;code&amp;gt;PracticeCenterHoldTime&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial, tutorial transition, or experimental block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
This parameter applies to both practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary experimental trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
Only successful experimental trials are written to this file. Practice trials are not written to the CSV.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether the participant tutorial/practice sequence is active.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive or disabled; experimental data&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Tutorial or practice sequence active&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;EnableIntroduction=1&amp;lt;/code&amp;gt;, this state becomes 1 at the beginning of the run and returns to 0 when the tutorial completes and the experiment begins.&lt;br /&gt;
&lt;br /&gt;
This is the primary state for separating tutorial/practice samples from experimental samples during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TutorialPhase===&lt;br /&gt;
&lt;br /&gt;
4-bit state indicating the current stage of the tutorial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Tutorial inactive&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: General introduction&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Normal free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Automatic instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Automatic practice&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Controlled instructions&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Controlled free movement&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Controlled practice&lt;br /&gt;
* &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;: Practice complete&lt;br /&gt;
&lt;br /&gt;
After the final automatic or controlled practice feedback interval, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; may remain 4 or 7 while &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt; has returned to 0 and the task waits for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Outside the tutorial, &amp;lt;code&amp;gt;TutorialPhase&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
===PracticeTrial===&lt;br /&gt;
&lt;br /&gt;
8-bit state identifying the active practice trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: No active practice trial&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: One-based practice trial number within the current practice condition&lt;br /&gt;
&lt;br /&gt;
The state remains nonzero through the practice trial&#039;s feedback phase.&lt;br /&gt;
&lt;br /&gt;
After the final practice feedback interval it returns to 0 while the tutorial may still wait for the participant to return to center.&lt;br /&gt;
&lt;br /&gt;
Resetting a practice trial does not increment &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs, including during free movement, practice, and experimental trials.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current trial phase.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Experimental block announcement or non-trial tutorial screen&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
During active practice trials, values 1 through 6 have the same meanings as during experimental trials.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt; is forced to 0. Therefore, &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; alone no longer uniquely identifies an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
Use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Introduction == 0 and TaskPhase == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to identify an experimental block announcement.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
During active practice trials, this state identifies the practice condition.&lt;br /&gt;
&lt;br /&gt;
During the general introduction and normal free-movement tutorial stages, it initially reports 0 even when the configured experiment is Controlled Only.&lt;br /&gt;
&lt;br /&gt;
During the experiment it retains its original meaning.&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current experimental block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
During the tutorial, this state is forced to 0. It should therefore only be interpreted as an experimental block type when &amp;lt;code&amp;gt;Introduction=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During experimental trials, generated values range from &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During practice trials, the state contains the deterministic practice-target angle.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is set to 0.&lt;br /&gt;
&lt;br /&gt;
After tutorial completion, the saved first experimental target is restored.&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, target states are suppressed.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
During practice trials, it describes the current deterministic practice target.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, target states are suppressed.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based experimental block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental block begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskBlock = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental block numbers.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall experimental trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the tutorial completes, the first experimental trial begins with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TaskTrial = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across experimental block boundaries. Manually resetting an experimental trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Practice trials do not consume experimental trial numbers.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current active practice or experimental trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 identifies movement onset.&lt;br /&gt;
&lt;br /&gt;
During non-trial tutorial screens, the state is forced to 0.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish practice movement onset from experimental movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches a practice or experimental target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
Experimental acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice acquisition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TargetHit == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets a practice or experimental trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
Experimental reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Practice reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TrialReset == 1 and Introduction == 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
The state is populated during successful practice and experimental trials.&lt;br /&gt;
&lt;br /&gt;
Practice timing values should be distinguished from experimental values using &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. During the tutorial, a rising press may advance eligible instruction or free-movement screens. It does not advance active practice trials and does not control experimental progression.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured experimental trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
Because the tutorial and practice sequence are recorded within the same BCI2000 run as the experiment, analyses should use &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; to distinguish experimental data from tutorial and practice data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! Recommended identification&lt;br /&gt;
|-&lt;br /&gt;
| Experimental samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Tutorial/practice samples&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block announcement&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Non-trial tutorial screen&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, typically with &amp;lt;code&amp;gt;TaskPhase == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt; and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target onset&lt;br /&gt;
| &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PracticeTrial &amp;gt; 0&amp;lt;/code&amp;gt;, and transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset == 1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Introduction == 1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Practice trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;PracticeTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Experimental block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;, interpreted together with &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed experimental block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;Introduction == 0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;, gated by &amp;lt;code&amp;gt;Introduction&amp;lt;/code&amp;gt; and the relevant trial event&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
Analyses written for earlier versions of the task should be updated before use with tutorial-enabled data. In particular:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskPhase=0&amp;lt;/code&amp;gt; no longer always identifies an experimental block announcement.&lt;br /&gt;
* &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt; may indicate a practice or experimental success.&lt;br /&gt;
* &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt; may indicate a practice or experimental reset.&lt;br /&gt;
* Nonzero timing states may belong to practice trials.&lt;br /&gt;
* &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt; should not be interpreted as experimental condition/block variables while &amp;lt;code&amp;gt;Introduction=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[Technical Reference:BCI2000 File Format|BCI2000 File Format]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12579</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12579"/>
		<updated>2026-09-02T19:26:33Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&lt;br /&gt;
The following video demonstrates the Visuomotor Joystick Task running in BCI2000, including the participant display and joystick-controlled task behavior: &amp;lt;youtube alignment=&amp;quot;center&amp;quot;&amp;gt;https://www.youtube.com/watch?v=LSZW3nxg3Vg&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12578</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12578"/>
		<updated>2026-09-01T22:50:55Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&lt;br /&gt;
The following video demonstrates the Visuomotor Joystick Task running in BCI2000, including the participant display and joystick-controlled task behavior.&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=LSZW3nxg3Vg Visuomotor Joystick Task Demonstration]&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12577</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12577"/>
		<updated>2026-09-01T17:04:33Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Scientific Basis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick (Any joystick should work, provided that Windows recognizes it as a game controller.) rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12576</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12576"/>
		<updated>2026-09-01T17:01:53Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alexander Speer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12575</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12575"/>
		<updated>2026-09-01T17:01:36Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Source Code Revisions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
Alexander Speer  &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;8/26/26&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;9/1/26&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12574</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12574"/>
		<updated>2026-09-01T17:00:40Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The source code for the Visuomotor Joystick Task is located in the BCI2000 private application directory:&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
The main application implementation is contained in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the corresponding header and build configuration in:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
Alexander Speer  &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12573</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12573"/>
		<updated>2026-09-01T16:59:01Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The current development source is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;src/custom/usb_hid_joystick_task/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main module files are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usb_hid_joystick_task&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module is created with &amp;lt;code&amp;gt;bci2000_add_application_module&amp;lt;/code&amp;gt;, requires C++17, and is declared &amp;lt;code&amp;gt;NOBUNDLE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/private/Application/VisuomotorJoystickTask&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
Alexander Speer  &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12572</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12572"/>
		<updated>2026-09-01T16:51:28Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The current development source is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;src/custom/usb_hid_joystick_task/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main module files are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usb_hid_joystick_task&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module is created with &amp;lt;code&amp;gt;bci2000_add_application_module&amp;lt;/code&amp;gt;, requires C++17, and is declared &amp;lt;code&amp;gt;NOBUNDLE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STILL NEEDS: public SVN contribution URL after the module is placed in its final contribution directory.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
Alexander Speer  &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12571</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12571"/>
		<updated>2026-09-01T16:50:33Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The current development source is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;src/custom/usb_hid_joystick_task/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main module files are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usb_hid_joystick_task&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module is created with &amp;lt;code&amp;gt;bci2000_add_application_module&amp;lt;/code&amp;gt;, requires C++17, and is declared &amp;lt;code&amp;gt;NOBUNDLE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEEDS MANUAL INPUT: public SVN contribution URL after the module is placed in its final contribution directory.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
Alexander Speer  &lt;br /&gt;
&lt;br /&gt;
Friedman Lab, Department of Neurosurgery&lt;br /&gt;
&lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: speer@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12570</id>
		<title>VisuomotorJoystickTask</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisuomotorJoystickTask&amp;diff=12570"/>
		<updated>2026-09-01T16:49:27Z</updated>

		<summary type="html">&lt;p&gt;Aes2376: Init&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Synopsis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USBHIDJoystickTask&#039;&#039;&#039; is a BCI2000 application module that implements a center-out visuomotor reaching task controlled with a USB HID joystick. The task is designed to compare movements made under a normal joystick-to-cursor mapping with movements made under an inverted mapping.&lt;br /&gt;
&lt;br /&gt;
During each trial, the participant moves a cursor to the center of the display, holds it there, waits through a warning period, and then moves to a peripheral target. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, joystick and cursor movements are congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, joystick-to-cursor movement is inverted after the target appears.&lt;br /&gt;
&lt;br /&gt;
The task is based on the visuomotor paradigm described by Neumann et al. (2018), which was developed to compare automatic and controlled movements and investigate their relationship to basal ganglia function and subthalamic deep brain stimulation in Parkinson&#039;s disease. The BCI2000 implementation adapts the original paradigm for USB joystick control and synchronized BCI2000 state recording.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
The current development source is located in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;src/custom/usb_hid_joystick_task/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main module files are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;USBHIDJoystickTask.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CMake target is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;usb_hid_joystick_task&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module is created with &amp;lt;code&amp;gt;bci2000_add_application_module&amp;lt;/code&amp;gt;, requires C++17, and is declared &amp;lt;code&amp;gt;NOBUNDLE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEEDS MANUAL INPUT: public SVN contribution URL after the module is placed in its final contribution directory.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Author===&lt;br /&gt;
&lt;br /&gt;
Alexander Speer  &lt;br /&gt;
Friedman Lab, Department of Neurosurgery  &lt;br /&gt;
Washington University in St. Louis  &lt;br /&gt;
&lt;br /&gt;
Developed in the Friedman Lab.&lt;br /&gt;
&lt;br /&gt;
Contact: your.email@wustl.edu&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
&lt;br /&gt;
The task was developed as a USB HID joystick implementation of the automatic/controlled visuomotor reaching paradigm described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
The current implementation includes:&lt;br /&gt;
&lt;br /&gt;
* Automatic and controlled visuomotor conditions.&lt;br /&gt;
* Ordered and pseudorandom experimental blocks.&lt;br /&gt;
* Configurable trial counts and trial timing.&lt;br /&gt;
* USB joystick input through BCI2000&#039;s input logging system.&lt;br /&gt;
* Selection of the participant display on multi-monitor Windows systems.&lt;br /&gt;
* BCI2000 state logging of task timing, cursor position, target position, condition, block structure, and trial events.&lt;br /&gt;
* A separate diagnostic window with trial information and manual trial reset.&lt;br /&gt;
* Trial-level reaction time, movement time, and total time measurements.&lt;br /&gt;
&lt;br /&gt;
The files inspected in the current development checkout are located under &amp;lt;code&amp;gt;src/custom&amp;lt;/code&amp;gt; and are not associated with SVN history in that checkout. Revision-specific history should therefore be updated once the contribution is placed in its final version-controlled location.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
&lt;br /&gt;
* Initial development: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Tested under: BCI2000 framework 3.6.9528.4, Release x64, MSVC 19.35&lt;br /&gt;
* Known to compile under: Visual Studio 2022 / MSVC 19.35 for a prior version of the current source&lt;br /&gt;
* Current source revision: &#039;&#039;&#039;NEEDS MANUAL INPUT&#039;&#039;&#039;&lt;br /&gt;
* Broken since: No known breaking revision&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
&lt;br /&gt;
===Scientific Basis===&lt;br /&gt;
&lt;br /&gt;
This task is a BCI2000 adaptation of the visuomotor task described by Neumann et al. (2018).&lt;br /&gt;
&lt;br /&gt;
In the original experiment, participants controlled a cursor using a pen and digitizing tablet. Targets appeared around a central fixation point. In the &#039;&#039;&#039;automatic&#039;&#039;&#039; condition, movement of the pen and cursor was congruent. In the &#039;&#039;&#039;controlled&#039;&#039;&#039; condition, the pen-to-cursor mapping was inverted. Automatic targets were shown in green and controlled targets in red.&lt;br /&gt;
&lt;br /&gt;
Trials in the original experiment began at a central fixation cross. Participants remained at the center for 3 seconds, after which a yellow warning cue appeared for 500 ms. The target appeared 500 ms after the warning cue. The original experiment used eight possible target positions arranged around the center and included both ordered condition blocks and a pseudorandom block.&lt;br /&gt;
&lt;br /&gt;
The present BCI2000 implementation preserves the central features of this paradigm, including the automatic and inverted controlled mappings, green and red targets, 3-second default center hold, 500-ms warning period, 500-ms pre-target delay, and ordered and mixed experimental structures.&lt;br /&gt;
&lt;br /&gt;
There are several implementation differences. The BCI2000 version uses a USB HID joystick rather than a digitizing tablet, allows the timing and number of trials to be configured, and generates targets over a continuous range of angles rather than restricting targets to eight positions. It also records task variables directly as synchronized BCI2000 states.&lt;br /&gt;
&lt;br /&gt;
See [[#References|References]] for the original study.&lt;br /&gt;
&lt;br /&gt;
===Experiment Structure===&lt;br /&gt;
&lt;br /&gt;
Four experiment modes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Mode&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Automatic Only&lt;br /&gt;
| Runs one block containing only automatic trials.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Controlled Only&lt;br /&gt;
| Runs one block containing only controlled trials.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Ordered&lt;br /&gt;
| Runs one automatic block and one controlled block. &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt; determines which condition occurs first.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Ordered + Pseudorandom&lt;br /&gt;
| Runs an ordered automatic block, an ordered controlled block, and then a mixed pseudorandom block containing both conditions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the mixed block, the application shuffles the configured numbers of automatic and controlled trials. The randomization attempts to avoid both strict alternation and excessively long runs of a single condition.&lt;br /&gt;
&lt;br /&gt;
===Trial Sequence===&lt;br /&gt;
&lt;br /&gt;
Each block begins with a 1.5-second announcement indicating whether the upcoming block is &#039;&#039;&#039;Automatic&#039;&#039;&#039;, &#039;&#039;&#039;Controlled&#039;&#039;&#039;, or &#039;&#039;&#039;Mixed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A trial then proceeds as follows:&lt;br /&gt;
&lt;br /&gt;
# The participant moves the cursor into the center region.&lt;br /&gt;
# Once centered, the participant must remain there for &amp;lt;code&amp;gt;CenterHoldSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A yellow warning marker appears for &amp;lt;code&amp;gt;WarningSeconds&amp;lt;/code&amp;gt;.&lt;br /&gt;
# A pre-target interval lasting &amp;lt;code&amp;gt;PreTargetDelaySeconds&amp;lt;/code&amp;gt; follows.&lt;br /&gt;
# The target appears.&lt;br /&gt;
# The participant moves the cursor into the target.&lt;br /&gt;
# Target acquisition records the trial timing measurements and begins the feedback interval.&lt;br /&gt;
# After &amp;lt;code&amp;gt;FeedbackSeconds&amp;lt;/code&amp;gt;, the task advances to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
If the participant leaves the center during the center-hold, warning, or pre-target interval, the task returns to the waiting-for-center phase and the preparation sequence begins again.&lt;br /&gt;
&lt;br /&gt;
A new target is generated when advancing to a new trial. Manually resetting a trial does not generate a new target.&lt;br /&gt;
&lt;br /&gt;
===Automatic Condition===&lt;br /&gt;
&lt;br /&gt;
During an automatic trial, cursor position follows the joystick using a direct mapping. Moving the joystick in one direction moves the cursor in the corresponding direction.&lt;br /&gt;
&lt;br /&gt;
Automatic targets are displayed in green.&lt;br /&gt;
&lt;br /&gt;
===Controlled Condition===&lt;br /&gt;
&lt;br /&gt;
During a controlled trial, the normal direct mapping is initially used while the participant returns to and holds the center.&lt;br /&gt;
&lt;br /&gt;
When the target appears, the current joystick position and cursor position are recorded as anchors. Cursor movement then becomes relative to those anchors and inverted. Moving the joystick away from its target-onset position causes the cursor to move in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
Conceptually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cursor position = anchor cursor position - joystick displacement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cursor is constrained to the participant display.&lt;br /&gt;
&lt;br /&gt;
After completion of a controlled trial, the inverted mapping remains active until the joystick has returned close to the joystick position recorded at target onset. This prevents an abrupt cursor jump when returning from the controlled mapping to the normal mapping.&lt;br /&gt;
&lt;br /&gt;
Controlled targets are displayed in red.&lt;br /&gt;
&lt;br /&gt;
===Joystick Input===&lt;br /&gt;
&lt;br /&gt;
Joystick input is provided through BCI2000&#039;s [[User Reference:Logging Input|input logging]] system.&lt;br /&gt;
&lt;br /&gt;
Joystick position states are expected to range from 0 through 32767. The application converts these values into internal task coordinates ranging from 0 through 1023.&lt;br /&gt;
&lt;br /&gt;
The application reads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt; is currently read by the task but is not used for trial progression or condition selection.&lt;br /&gt;
&lt;br /&gt;
Joystick recording is normally enabled using the &amp;lt;code&amp;gt;LogJoystick&amp;lt;/code&amp;gt; option. See [[User Reference:Logging Input#LogJoystick|LogJoystick]] for configuration details.&lt;br /&gt;
&lt;br /&gt;
===Target Generation===&lt;br /&gt;
&lt;br /&gt;
A new target angle is generated for each new trial.&lt;br /&gt;
&lt;br /&gt;
The random target generator produces an integer between 0 and 3599. &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt; therefore represents tenths of a degree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
angle in degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces target angles from 0.0 through 359.9 degrees.&lt;br /&gt;
&lt;br /&gt;
Targets are positioned at a fixed distance from the center using the generated angle.&lt;br /&gt;
&lt;br /&gt;
Unlike the original Neumann et al. experiment, which used eight circularly arranged target locations, the BCI2000 implementation allows targets to appear over a continuous range of angles.&lt;br /&gt;
&lt;br /&gt;
===Trial Phases===&lt;br /&gt;
&lt;br /&gt;
The current phase of the task is recorded in &amp;lt;code&amp;gt;TaskPhase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Phase&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Block announcement&lt;br /&gt;
| The upcoming block type is being displayed.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for center&lt;br /&gt;
| The task is waiting for the cursor to enter the center region.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Holding center&lt;br /&gt;
| The participant is completing the required center hold.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Warning&lt;br /&gt;
| The yellow warning cue is visible.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pre-target delay&lt;br /&gt;
| The warning has ended and the task is waiting for target onset.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Target visible&lt;br /&gt;
| The peripheral target is visible and movement may occur.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Feedback&lt;br /&gt;
| The target has been acquired and the task is waiting before advancing.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Finished&lt;br /&gt;
| All configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt; marks target onset.&lt;br /&gt;
&lt;br /&gt;
===Condition and Block Encodings===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State/Parameter&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Ordered automatic block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Ordered controlled block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
| Pseudorandom mixed block&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0&lt;br /&gt;
| Automatic first&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;OrderedStartCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1&lt;br /&gt;
| Controlled first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Participant Display===&lt;br /&gt;
&lt;br /&gt;
The participant-facing [[Programming Reference:ApplicationWindow Class|ApplicationWindow]] contains:&lt;br /&gt;
&lt;br /&gt;
* A light gray background.&lt;br /&gt;
* A black cursor.&lt;br /&gt;
* A black central fixation cross.&lt;br /&gt;
* A gray center marker.&lt;br /&gt;
* A larger yellow warning marker.&lt;br /&gt;
* A green target during automatic trials.&lt;br /&gt;
* A red target during controlled trials.&lt;br /&gt;
* A progress bar near the top of the display.&lt;br /&gt;
* Block announcements.&lt;br /&gt;
* An &amp;quot;ended&amp;quot; message when all trials are complete.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;StimulusDisplay&amp;lt;/code&amp;gt; parameter may be used to select the physical monitor on which the participant window appears.&lt;br /&gt;
&lt;br /&gt;
===Diagnostic Window===&lt;br /&gt;
&lt;br /&gt;
A separate diagnostic window is shown to the experimenter. It displays information including:&lt;br /&gt;
&lt;br /&gt;
* Current condition and task phase.&lt;br /&gt;
* Current block and block type.&lt;br /&gt;
* Overall and condition-specific trial numbers.&lt;br /&gt;
* Target angle and coordinates.&lt;br /&gt;
* Raw joystick states and converted task coordinates.&lt;br /&gt;
* Cursor coordinates.&lt;br /&gt;
* Movement status.&lt;br /&gt;
* Reaction time, movement time, and total time.&lt;br /&gt;
* Completed-trial and reset counts.&lt;br /&gt;
* Mean timing measurements for automatic, controlled, and overall performance.&lt;br /&gt;
&lt;br /&gt;
The diagnostic window also provides a button for manually resetting the current trial.&lt;br /&gt;
&lt;br /&gt;
===Trial Reset===&lt;br /&gt;
&lt;br /&gt;
A trial may be manually reset before it reaches the feedback phase.&lt;br /&gt;
&lt;br /&gt;
Resetting a trial:&lt;br /&gt;
&lt;br /&gt;
* Returns the task to the waiting-for-center phase.&lt;br /&gt;
* Clears the current movement and timing states.&lt;br /&gt;
* Generates a &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Increments the diagnostic reset count.&lt;br /&gt;
* Keeps the same trial number.&lt;br /&gt;
* Keeps the same target.&lt;br /&gt;
* Does not write a completed-trial row to the secondary CSV file.&lt;br /&gt;
&lt;br /&gt;
A trial cannot be reset after it has already entered feedback.&lt;br /&gt;
&lt;br /&gt;
===Timing Measurements===&lt;br /&gt;
&lt;br /&gt;
The task calculates reaction time, movement time, and total time for each successfully completed trial.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reaction time&#039;&#039;&#039; is the interval between target appearance and detected movement onset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Movement time&#039;&#039;&#039; is the interval between detected movement onset and target acquisition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total time&#039;&#039;&#039; is the interval between target appearance and target acquisition.&lt;br /&gt;
&lt;br /&gt;
Movement onset is detected when either joystick axis differs from the center-hold baseline by more than the task&#039;s joystick deadzone.&lt;br /&gt;
&lt;br /&gt;
Timing is measured using a steady clock, but movement onset and target acquisition are detected during calls to &amp;lt;code&amp;gt;Process()&amp;lt;/code&amp;gt;. The effective temporal resolution is therefore limited by the BCI2000 processing-block interval.&lt;br /&gt;
&lt;br /&gt;
===Data Recording===&lt;br /&gt;
&lt;br /&gt;
The task records its behavioral variables as BCI2000 states, allowing them to be synchronized with the normal BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; recording.&lt;br /&gt;
&lt;br /&gt;
Joystick coordinates are also recorded when [[User Reference:Logging Input#LogJoystick|joystick input logging]] is enabled.&lt;br /&gt;
&lt;br /&gt;
The current implementation additionally writes a secondary CSV file containing one row for each successfully completed trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trial,block,block_type,condition,reaction_time_ms,movement_time_ms,total_time_ms,success&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset trials do not generate CSV rows.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
===ExperimentMode===&lt;br /&gt;
&lt;br /&gt;
Selects the overall experimental structure.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;1-4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Automatic only&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Controlled only&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Ordered automatic and controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Ordered automatic, ordered controlled, and pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the trial-count parameters required by the selected mode are at least 1.&lt;br /&gt;
&lt;br /&gt;
===AutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials used by experiment modes 1 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===ControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials used by experiment modes 2 and 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used by the selected experiment mode, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedStartCondition===&lt;br /&gt;
&lt;br /&gt;
Determines which condition is presented first in experiment mode 3.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic first&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled first&lt;br /&gt;
&lt;br /&gt;
This parameter does not affect experiment modes 1, 2, or 4.&lt;br /&gt;
&lt;br /&gt;
===OrderedAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials in the ordered automatic block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===OrderedControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials in the ordered controlled block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomAutomaticTrials===&lt;br /&gt;
&lt;br /&gt;
Number of automatic trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===RandomControlledTrials===&lt;br /&gt;
&lt;br /&gt;
Number of controlled trials included in the pseudorandom block of experiment mode 4.&lt;br /&gt;
&lt;br /&gt;
Type: integer&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declared range: &amp;lt;code&amp;gt;0-10000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When mode 4 is selected, the value must be at least 1.&lt;br /&gt;
&lt;br /&gt;
===StimulusDisplay===&lt;br /&gt;
&lt;br /&gt;
Selects the physical display used for the participant-facing application window.&lt;br /&gt;
&lt;br /&gt;
Type: integer enumeration&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Use the normal/default ApplicationWindow placement.&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and above: Select one of the displays detected when the parameters are published.&lt;br /&gt;
&lt;br /&gt;
On Windows, available monitors are enumerated with their dimensions and primary-display status.&lt;br /&gt;
&lt;br /&gt;
The application verifies during preflight that the selected display exists.&lt;br /&gt;
&lt;br /&gt;
===CenterHoldSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration for which the participant must keep the cursor within the center region before the trial may continue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during this interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===WarningSeconds===&lt;br /&gt;
&lt;br /&gt;
Duration of the yellow warning cue.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Leaving the center during the warning interval restarts the center-acquisition sequence.&lt;br /&gt;
&lt;br /&gt;
===PreTargetDelaySeconds===&lt;br /&gt;
&lt;br /&gt;
Delay between the end of the warning cue and target appearance.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
The participant must remain centered during this interval.&lt;br /&gt;
&lt;br /&gt;
===FeedbackSeconds===&lt;br /&gt;
&lt;br /&gt;
Interval between successful target acquisition and advancement to the next trial or block.&lt;br /&gt;
&lt;br /&gt;
Type: floating point&lt;br /&gt;
&lt;br /&gt;
Default: &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
Range: &amp;lt;code&amp;gt;0.0-60.0&amp;lt;/code&amp;gt; seconds&lt;br /&gt;
&lt;br /&gt;
===ResultsFile===&lt;br /&gt;
&lt;br /&gt;
Specifies the file used for the secondary trial-level CSV output.&lt;br /&gt;
&lt;br /&gt;
Type: string&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;block_visuomotor_results_usb_hid.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file is opened when the application initializes and is overwritten if a file with the same name already exists. Initialization fails if the file cannot be created.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
&lt;br /&gt;
The following states are defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; and are recorded with the normal BCI2000 data stream.&lt;br /&gt;
&lt;br /&gt;
===CursorX===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current horizontal cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===CursorY===&lt;br /&gt;
&lt;br /&gt;
10-bit state representing the current vertical cursor coordinate.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Produced range: &amp;lt;code&amp;gt;0-1023&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is updated continuously while the task runs.&lt;br /&gt;
&lt;br /&gt;
===TaskPhase===&lt;br /&gt;
&lt;br /&gt;
3-bit state containing the current phase of the task.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Block announcement&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Waiting for center&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Holding center&lt;br /&gt;
* &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;: Warning&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;: Pre-target delay&lt;br /&gt;
* &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;: Target visible&lt;br /&gt;
* &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: Feedback&lt;br /&gt;
* &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;: Finished&lt;br /&gt;
&lt;br /&gt;
A transition from 4 to 5 may be used to identify target onset during offline analysis.&lt;br /&gt;
&lt;br /&gt;
===TaskCondition===&lt;br /&gt;
&lt;br /&gt;
1-bit state identifying the current movement condition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Controlled&lt;br /&gt;
&lt;br /&gt;
===TaskBlockType===&lt;br /&gt;
&lt;br /&gt;
2-bit state identifying the type of the current block.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;: Ordered automatic&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;: Ordered controlled&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: Pseudorandom mixed&lt;br /&gt;
&lt;br /&gt;
===TargetAngle===&lt;br /&gt;
&lt;br /&gt;
12-bit state containing the target angle in tenths of a degree.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generated range: &amp;lt;code&amp;gt;0-3599&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To convert to degrees:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
degrees = TargetAngle / 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TargetX===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the horizontal coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TargetY===&lt;br /&gt;
&lt;br /&gt;
10-bit state containing the vertical coordinate of the current target.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;512&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coordinate units correspond to the task&#039;s 0-through-1023 coordinate system.&lt;br /&gt;
&lt;br /&gt;
===TaskBlock===&lt;br /&gt;
&lt;br /&gt;
8-bit state containing the current one-based block number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During a run, block numbering begins at 1.&lt;br /&gt;
&lt;br /&gt;
===TaskTrial===&lt;br /&gt;
&lt;br /&gt;
16-bit state containing the current one-based overall trial number.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trial numbering continues across block boundaries. Manually resetting a trial does not increment &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===MovementStarted===&lt;br /&gt;
&lt;br /&gt;
1-bit state indicating whether movement onset has been detected during the current trial.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state changes to 1 when joystick displacement exceeds the movement deadzone after target onset. It remains high during the remainder of the movement and feedback period.&lt;br /&gt;
&lt;br /&gt;
A rising transition from 0 to 1 may be used to identify movement onset.&lt;br /&gt;
&lt;br /&gt;
===TargetHit===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating successful target acquisition.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the cursor reaches the target and is cleared at the beginning of the following processing block. It therefore acts as a one-processing-block pulse.&lt;br /&gt;
&lt;br /&gt;
===TrialReset===&lt;br /&gt;
&lt;br /&gt;
1-bit event-like state indicating a manual trial reset.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state is set to 1 when the experimenter successfully resets the current trial and is cleared at the beginning of the following processing block.&lt;br /&gt;
&lt;br /&gt;
===ReactionTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing reaction time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reaction time is measured from target appearance to detected movement onset. The value is assigned when the target is acquired and remains available through the feedback interval.&lt;br /&gt;
&lt;br /&gt;
===MovementTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing movement time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Movement time is measured from detected movement onset to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===TotalTimeMs===&lt;br /&gt;
&lt;br /&gt;
32-bit state containing total target-directed trial time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
Initial value: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total time is measured from target appearance to target acquisition.&lt;br /&gt;
&lt;br /&gt;
===External Joystick States===&lt;br /&gt;
&lt;br /&gt;
The application also uses states provided by BCI2000&#039;s [[User Reference:Logging Input|input logging]] system. These states are not defined by &amp;lt;code&amp;gt;USBHIDJoystickTask&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickXpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Horizontal joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickYpos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vertical joystick position. BCI2000 joystick input logging uses values from 0 through 32767.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JoystickButtons1&amp;lt;/code&amp;gt;&lt;br /&gt;
| State of joystick button 1. The application reads this state but does not currently use it for task control.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Standard BCI2000 system state. The application sets it to 0 when all configured trials have been completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For details about enabling joystick recording and the joystick states provided by BCI2000, see [[User Reference:Logging Input|Logging Input]].&lt;br /&gt;
&lt;br /&gt;
===Data Analysis Notes===&lt;br /&gt;
&lt;br /&gt;
The task states are intended to allow trial behavior to be reconstructed from the BCI2000 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Measurement/Event&lt;br /&gt;
! State identification&lt;br /&gt;
|-&lt;br /&gt;
| Trial number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskTrial&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Block number&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlock&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Automatic vs. controlled&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskCondition&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ordered vs. mixed block&lt;br /&gt;
| &amp;lt;code&amp;gt;TaskBlockType&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target onset&lt;br /&gt;
| Transition from &amp;lt;code&amp;gt;TaskPhase=4&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TaskPhase=5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement onset&lt;br /&gt;
| Rising transition of &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Successful target acquisition&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetHit=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manual reset&lt;br /&gt;
| &amp;lt;code&amp;gt;TrialReset=1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Reaction time&lt;br /&gt;
| &amp;lt;code&amp;gt;ReactionTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Movement time&lt;br /&gt;
| &amp;lt;code&amp;gt;MovementTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Total time&lt;br /&gt;
| &amp;lt;code&amp;gt;TotalTimeMs&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cursor trajectory&lt;br /&gt;
| &amp;lt;code&amp;gt;CursorX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CursorY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target coordinates&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetX&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TargetY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Target angle&lt;br /&gt;
| &amp;lt;code&amp;gt;TargetAngle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TargetHit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TrialReset&amp;lt;/code&amp;gt; are single-processing-block pulses. &amp;lt;code&amp;gt;MovementStarted&amp;lt;/code&amp;gt;, in contrast, remains high after movement onset until the trial advances or is reset.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Neumann WJ, Schroll H, de Almeida Marcelino AL, Horn A, Ewert S, Irmen F, Krause P, Schneider GH, Hamker F, Kühn AA. [https://doi.org/10.1093/brain/awy206 Functional segregation of basal ganglia pathways in Parkinson&#039;s disease]. &#039;&#039;Brain&#039;&#039;. 2018;141(9):2655-2669. doi:10.1093/brain/awy206.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[User Reference:Logging Input|Logging Input]]&lt;br /&gt;
* [[User Reference:Logging Input#LogJoystick|LogJoystick]]&lt;br /&gt;
* [[User Reference:Module Command Line Options|Module Command Line Options]]&lt;br /&gt;
* [[Programming Reference:ApplicationWindow Class|ApplicationWindow Class]]&lt;br /&gt;
* [[User Reference:Data File Formats|BCI2000 Data File Formats]]&lt;br /&gt;
* [[Programming Reference:ApplicationBase Class|ApplicationBase Class]]&lt;/div&gt;</summary>
		<author><name>Aes2376</name></author>
	</entry>
</feed>