<?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-09-10T01:09:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<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>