___________________________________________________________________________________________________________________ *DOT MOTION DISPLAY - CONSTANT STIMULI PROCEDURE* ___________________________________________________________________________________________________________________ Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC Date: 03-10-2021 last updated: 01-13-2025 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 01-13-2025 Millisecond Software ___________________________________________________________________________________________________________________ BACKGROUND INFO ___________________________________________________________________________________________________________________ This helper script implements a constant stimuli procedure using Random-Dot Kinematograms. It was originally pogrammed for the lab of Dr. Aaron Seitz for a validation study conducted by Kimia Yaghoubi in INQUISIT6. IMPORTANT: This Inquisit7 script uses a different mode to display the random dots than the original Inquisit6 "iqx" script programmed for the comparison study (Yaghoubi et al, 2022): the RDK 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). //References: Yaghoubi, K. C., Kabbara, S., Arian, S., Kobaissi, H., Peters, M. A. K., & Seitz, A. R. (2022). Comparing random dot motion in MATLAB vs. Inquisit Millisecond. Frontiers in Psychology, 13, 1035518–1035518. https://doi.org/10.3389/fpsyg.2022.1035518 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: [http://doi.org/10.5334/jors.194] (Note: Millisecond slightly edited the provided "jspsych-rdk.js" plugin code to allow the cross to be moved in the direction of the coherent dots). ___________________________________________________________________________________________________________________ DURATION ___________________________________________________________________________________________________________________ the default set-up of the script takes appr. 12 minutes to complete __________________________________________________________________________________________________________________ DATA OUTPUT DICTIONARY ___________________________________________________________________________________________________________________ The fields in the data files are: (1) Raw data file: 'rdkt_constantstimuli_dynamicdots_raw*.iqdat' (a separate file for each participant)* build: The specific Inquisit version used (the 'build') that was run computer.platform: the platform the script was run on (win/mac/ios/android) display.canvasHeight, display.canvasWidth: the pixel width and height of the active canvas used on the current computer display.refreshrate, display.refreshInterval: refreshrate and interval of the current monitor (see also values.dotposition) date, time, date and time script was run subject/subject with the current subject number (both built-in and custom) session/Session: with the current session id (both built-in and custom) run: the current run number blockCode, blockNum: the name and number of the current block (built-in Inquisit variable) trialCode, trialNum: the name and number of the currently recorded trial (built-in Inquisit variable) Note: 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 numberOfDots: sets the total number of dots on the screen (MAX: 100) dotSize: the relative diameter of the dots (relative to canvas height which is 100%) speed: calculated as %screen height displacement per 'frame' blockCounterPerRun: blockcounter (there should be blocks for each run = 160 trials) test: "dummy": first trial in a block to 'warm up the rdk display' "test": actual test trial trialCounter: counts the trials (max: 160) run //IVs: coherence: the currently selected coherence angle: the currently selected angle (rotation is COUNTERclockwise) stimDuration: the currently selected stim duration corrQuadrant: the screen quadrant of the correct response coordinates (countercounterclockwise) top: 1 (right: angles 360/0-89), 2 (left: angles 90-179) bottom: 3 (left: angles 180-269), 4 (right: angles 270-359) //DVs: responseCoordinatesQuadrant: the screen quadrant of the given response coordinates response: the participant's response (here: selection of correctAxis vs. incorrectAxis) responseX, responseY: the pixel responses for the vertical (y) and horizontal (x) coordinates on the active canvas responseAngleDegrees: the calculated response angle (Note: 0degrees is W->E, COUNTERclockwise) angleDiff: the difference between response angle and direction angle correct: 1 = correct; 0 = error Note: a response is correct if expressions.angleDiff is < 22.5 latency: the response latency (in ms) ___________________________________________________________________________________________________________________ EXPERIMENTAL SETUP ___________________________________________________________________________________________________________________ This helper script implements a constant stimuli procedure. The main procedure runs 160 trials each (160 trials = 1 run). 1 block: runs 80 trials (repeated twice per run) runs 10 coherence values x 4 direction angles x 2 stim durations (order randomly determined) Trial Sequence: - Fixation Dot 250ms - stimulus Display (200ms vs. 800ms) - responseDelay (500ms) - response Display (max. 4000ms): valid response is a mouse click on the display (if selected angle is within 22.5degress of the directional angle, the response is scored as correct) - iti (400ms) Note: the first trial in each block presents a 'dummy' trial to 'warm' up the html display for the actual test trials. ___________________________________________________________________________________________________________________ STIMULI ___________________________________________________________________________________________________________________ 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). DOT DISPLAYS: - selected aperture Type: 1 = circle (values.apertureType piped into "jspsych-rdk.js") - selected RDK Type: 4 (values.RDKType piped into "jspsych-rdk.js") => Signal dots can turn into noise dots & noise dots are randomly positioned in each frame Each frame randomly dedicates some dots to be signals and others to be noise dots. Thus a dot that moves as a signal dot from position2 to position3 might randomly be selected to be a random noise dot for position4 (see Pilly & Seitz, 2009, figure1, p.3: "signal dots are recruited afresh from each frame to the next". However, for each frame, the same number of dots are recruited to be signal dots. Signal dots move in coherent fashion; noise dots are randomly placed - number of dots: 100 (values.numberOfDots piped into "jspsych-rdk.js") Directional cross The directional cross is generated by two rectangles rotated by the directional angle with an invisible (gray) rectangle to cover the cross section. ___________________________________________________________________________________________________________________ INSTRUCTIONS ___________________________________________________________________________________________________________________ provided by Kimia Yaghoubi ___________________________________________________________________________________________________________________ EDITABLE CODE ___________________________________________________________________________________________________________________ check below for (relatively) easily editable parameters, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The parameters you can change are: //sizing parameters / fixationSize = 3% //the relative size of the fixation stim (relative to canvas height) //trial timing parameters / iti = 400 //the intertrial interval (in ms): shows the red dot / fixationDuration = 250 //the duration (in ms) of the fixation stim (the white dot) / responseDelay = 500 //the duration (in m) of the blank phase after dot display presentation and response trial / maxResponseDuration = 4000 //the max. duration (in ms) of the response trial / feedbackDuration = 500 //the feedback duration (in ms) //stim duration values (2) / stimDuration1 = 200 / stimDuration2 = 800 //coherence values (10): / coherence1 = 0.02 / coherence2 = 0.04 / coherence3 = 0.06 / coherence4 = 0.08 / coherence5 = 0.1 / coherence6 = 0.15 / coherence7 = 0.2 / coherence8 = 0.25 / coherence9 = 0.3 / coherence10 = 0.5 //angle-direction values (4): / angle1 = 45 / angle2 = 135 / angle3 = 225 / angle4 = 315 //experimental design parameters / blockRepeatsPerRun = 2 //repeats the block (80 trials) twice per run //response leniency / maxAngleDiff = 22.5 //the max. difference btw. response angle and direction angle that is considered to be correct