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: April 23, 2021
Last Modified: May 13, 2026 by K. Borchert (katjab@millisecond.com), Millisecond
Script Copyright © Millisecond Software, LLC
This script runs a demonstration of 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.
The random dot displays in this script 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).
1 minutes
Each trial presents a random dot display: a display of moving dots with X amount of dots that move in in a coherent direction and Y amount of randomly moving dots. A cross is presented in the center of the display to demonstrate the dominant movement direction.
Before each RDM display is presented, the following parameters can be set:
- choose the RDK type - aperture type - relative dot size - number of dots (up to 300) - movement coherence (1% to 100%) - 'speed' of coherent dots - movement angle (direction of movement) - duration of rdk movement display
This script runs as many demo trials as needed.
Fixed in this script: The random dot display will be presented with a border and a cross in the center. The cross is rotated in such a way that one arm points in the direction of the movement; the other is orthogonal to it.
File Name: rdk_demo_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. |
| stimulusItem | The presented stimuli in order of trial presentation |
| response | The participant's response |
| latency | The response latency (in ms) |
Display |
|
| rdkType | 1: signal dots always stay signal dots & noise dots are randomly positioned in each frame (no trajectories for random dots) 2: signal signal dots always stay signal dots & noise dots are on random trajectories that change directions randomly in each frame 3: signal signal dots always stay signal dots & noise dots are placed on random trajectories that do not change directions 4: signal dots can turn into noise dots & noise dots are randomly positioned in each frame 5: signal dots can turn into noise dots & noise dots are on random trajectories that change directions randomly in each frame 6: signal dots can turn into noise dots & noise dots are placed on random trajectories that do not change directions for 4/5/6 it is randomly decided in each frame which dot is a signal dot and which dot is a noise dot. |
| apertureType | 1 = circle 2 = ellipse 3 = square 4 = rectangle |
| dotRadiusPct | The radius of the dots in canvasHeight Pct |
| numberOfDots | The number of dots currently on display |
| coherence | The selected coherence value (percentage of signal dots) |
| direction | The selected motion angle (counterclockwise) 0: movement from E->W 90: movement from S->N 180: movement from W->E 270: movement from N->S |
| moveDistancePct | The selected 'speed' of signal dots |
| duration | The display duration in ms |
The procedure can be adjusted by setting the following parameters.
| Name | Description | Default |
|---|---|---|
| backgroundColor | Choose from "white", "gray", "black", "red", "orange", "yellow", "green", "blue", "purple" The rdk display will be presented in the same color | "black" |
| textColor | The default text color | white |