Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com), Millisecond
Credits:
Millisecond thanks Dr. Aaron Seitz for his generous help with Random Dot Motion Displays!
Created: March 10, 2021
Last Modified: May 20, 2026 by K. Borchert (katjab@millisecond.com), Millisecond
Script Copyright © Millisecond Software, LLC
This script runs a double staircase procedure to find coherence thresholds for Random Dot Motion (RDM) (aka Random-Dot Kinematogram - RDK) displays. Random dot motion (RDM) displays are the gold standard stimulus types used in psychophysical and physiological studies of motion processing.
In this script, the random dot displays are presented via an animated html-element that uses the jsPsych framework (Josh de Leeuw, 2008) and the "jspsych-rdk.js" plugin (Rajananda, 2018).
Pilly, P.K. & Aaron R. Seitz, A.R (2009) What a difference a parameter makes: A psychophysical comparison of random dot motion algorithms, Vision Research, 49, 1599-1612, https://doi.org/10.1016/j.visres.2009.03.019.
Rajananda, S., Lau, H. & Odegaard, B., (2018). A Random-Dot Kinematogram for Web-Based Vision Research. Journal of Open Research Software. 6(1), p.6. DOI: [https://doi.org/10.5334/jors.194] ( Millisecond slightly edited the provided "jspsych-rdk.js" plugin code to allow the cross to be moved in the direction of the coherent dots).
7 minutes
Each trial presents a random dot display for about 2s: a display of moving dots with X amount of dots that move in in a coherent direction and Y amount of randomly moving dots. At the end of the trial, a white cross is presented and participants are asked to choose the axis that shows the direction in which the majority of dots were moving.
The Random Dot Kinematrogram are displayed via an animated html-element
that uses the jsPsych framework (Josh de Leeuw, 2008) and the "jspsych-rdk.js" plugin
(Rajananda, 2018).
File Name: staircase_rdkt_main_summary*.iqdat
| Name | Description |
|---|---|
| startDate | Date the session was run |
| startTime | Time the session was run |
| subjectId | Participant ID |
| groupId | Group number |
| sessionId | Session number |
| elapsedTime | Session duration in ms |
| inquisit.version | Inquisit version number |
| computer.platform | Device platform: win | mac |ios | android |
| computer.touch | 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities |
| computer.hasKeyboard | 0 = no external keyboard detected; 1 = external keyboard detected |
| completed | 0 = Test was not completed 1 = Test was completed |
Settings |
|
| numberOfDots | The number of dots in the dot display |
| dotSize | The proportional sizing of the dot (proportional to canvas height) |
| radius | The proportional radius (to canvas height) of the background circle (max: 0.5) |
| speed | Movement 'speed' (as calculated as %screen height displacement per 'frame') |
| dotPositionDuration | The duration (in ms) that a dot stays in one place |
| animationDuration | The entire duration (in ms) of the animation (121*dotPositionDuration) |
Data |
|
| thresholdStaircase1 | The calculated coherence threshold for staircase1 |
| thresholdStaircase2 | The calculated coherence threshold for staircase2 |
| threshold | The mean of the two calculated thresholds |
File Name: staircase_rdkt_main_raw*.iqdat
| Name | Description |
|---|---|
| date | Date the session was run |
| time | Time the session was run |
| subject | Participant ID |
| group | Group number |
| session | Session number |
| build | Inquisit version number |
| computer.platform | Device platform: win | mac |ios | android |
| computer.touch | 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities |
| computer.hasKeyboard | 0 = no external keyboard detected; 1 = external keyboard detected |
| blockcode | The name the current block (built-in Inquisit variable) |
| blocknum | The number of the current block (built-in Inquisit variable) |
| trialcode | The name of the currently recorded trial (built-in Inquisit variable) |
| trialnum | The number of the currently recorded trial (built-in Inquisit variable) trialnum is a built-in Inquisit variable; it counts all trials run even those that do not store data to the data file. |
Constant Settings |
|
| rdkType | 4: signal dots can turn into noise dots & noise dots are randomly positioned in each frame |
| apertureType | 1 = circle |
Settings |
|
| numberOfDots | The number of dots in the dot display |
| dotSize | The proportional sizing of the dot (proportional to canvas height) |
| radius | The proportional radius (to canvas height) of the background circle (max: 0.5) |
| speed | Movement 'speed' (as calculated as %screen height displacement per 'frame') |
| dotPositionDuration | The duration (in ms) that a dot stays in one place |
| animationDuration | The entire duration (in ms) of the animation (121*dotPositionDuration) |
Trialdata |
|
| trialCounter | Tracks the number of staircases trial run (max: 300) |
| staircase | 1 vs. 2 (the current staircase run) |
| angle | The angle (counterclockwise) of the directional movement of the signal dots |
| coherence | The currently tested coherence |
| reversal | 1 = reveral detected; 0 = no reversal |
Per Staircase |
|
| staircase1Direction | The coherence direction of the current staircase (1 = down, 2 = up) |
| staircase1Coherence | The last tested coherence of staircase1 |
| staircase1NewCoherence | The next coherence to be tested for staircase1 |
| staircase1ReversalCount | The number of reversals for staircase1 |
| staircase1MaxCoherenceCount | The number of consecutive max (1.0) coherence tests for staircase1 |
| staircase1MinCoherenceCount | The number of consecutive min (0.1) coherence tests for staircase1 |
| staircase1ConsecutiveCorrect | The number of consecutive correct responses for staircase1 |
| staircase1stop | 1 = staircase1 has reached stopping point; 0 = staircase1 has not reached a stopping point yet |
Dvs |
|
| response | The participant's response correctAxis incorrectAxis |
| correct | Accuracy of response: 1 = correct response; 0 = otherwise |
| latency | The response latency (in ms); measured from: onset of axes display |
The procedure can be adjusted by setting the following parameters.
| Name | Description | Default |
|---|---|---|
| skipParameterSelectionProcedure | True: the RDM parameters (e.g. number of dots etc.) have been set a priori false: the RDM parameters (e.g. number of dots etc.) are selected at start of script | false |
Staircase Parameters |
||
| maxConsecutiveCorrect | The number of consecutive correct responses before coherence gets reduced (= 3 down, 1 up staircase) | 3 |
| stepSizeAdjustment | Factor to adjust the current coherence down: current coherence times factor up: current coherence divided by factor | 0.9 |
| minimumCoherence | 1 out of 100 is the minimum coherence that can be run with 100 dots | 0.01 |
| maximumCoherence | 1 is always the maximum coherence that can be run | 1 |
| maxReversals | The number of reversal points collected per staircase reversal point = coherence at point of reversal of staircase direction | 7 |
| maxExtremeValues | The number of times the staircase procedure is repeated if participant continously works at one of the extreme values | 3 |
| staircase1StartCoherence | The starting coherence for staircase1 | 0.15 |
| staircase2StartCoherence | The starting coherence for staircase2 | 0.05 |
| runRandomTrials | True: the script occasionally runs random dot displays false: no random dot displays are run | false |