Running a Task
a. Loading a Conditions/Userloop File
To start a task, load either a conditions file or a userloop file. A conditions file is a text file (*.txt) that describes what stimuli need to be presented with which timing script. A userloop file (*.m) does the same but it is a MATLAB function rather than a text file.
Either file can be loaded by clicking the [Load a conditions file] button. The file-open dialog shows *.txt files, by default, so change the extension type in the dialog to choose a userloop function (*.m). Alternately create a txt file and put the filename of the userloop function in it.
Upon loading a conditions file, some menu options are populated and activated, such as the "Blocks" pane and the "Blocks to run" button. These options are important to control the task flow.
- If you click on a different block number in the "Blocks" pane, "Total # of conditions in this block", "# of trials to run in this block" and "Count only correct trials change" change accordingly. Use these options to customize how many trials to run in each block.
- "Blocks to run" permits running only a subset of the defined blocks. "First block to run" selects which blocks to run initially.
- These options remain inactive, in case that a userloop function is selected. It is because a userloop function is to bypass NIMH ML's built-in task control and let users decide what stimuli and which conditions file to use.
"Total # of trials to run" and "Total # of blocks to run" control when the task will stop. The task will pause whichever occurs first.
Additionally, configure the size and resolution of the subject screen (see Calibrating Eye/Joystick Signals) and the DAQ device (see the Input / Output submenu & the Analog Input Ground Configuration section of NI Multifunction I/O Device), to run the experiment properly.
This pause menu appears when the RUN button is hit or when the task is paused. In this menu, the following options are available. The user can use either a hotkey or mouse-click to select an option.
- [Space] key: Start/resume the task
- [Q] key: Quit the task
- [B] key: Select a new block
- [X] key: Alter behavioral-error handling
- [E] key: Recalibrate Eye #1
- [R] key: Recalibrate Eye #2
- [D] key: Eye auto drift correction
- [J] key: Recalibrate Joystick #1
- [K] key: Recalibrate Joystick #2
- [W] key: Webcam setup
- [V] key: Edit timing file variables
- [S] key: Simulation mode On/Off
c. Control Screen
- Replica of the subject screen: This panel displays extra information that is available for the experimenter only, such as the real-time input state, the location and size of fixation windows, reward delivery, etc., in addition to the stimuli presented to the subject. User-defined dynamic texts can be displayed here during trials (see the dashboard runtime function).
- Time line of events: Too many (~several hundreds) events may make it really slow to update this figure. If that happens, stop updating this figure by setting TrialRecord.DrawTimeLine false.
- Trial counts and results: Trial results are number-coded as specified in the trialerror runtime function. The zoom level is adjustable only while the task is paused.
- User text/warning panel: Texts sent by user_text and user_warning functions are displayed here. They are updated at the end of each trial, whereas the texts sent by dashboard are displayed immediately.
- User plot: This figure can be used to show the result of online behavior analysis. Users can register their own functions in the Task submenu. If no function is registered, a default reaction time graph will be drawn. At the end of each trial, the value of the variable 'rt' is used to update this reaction time graph.
During trials, the following hotkeys are available.
- [ESC] key: Pauses the task.
- [C] key: Brings Eye #1 to the center of the screen.
- [V] key: Brings Eye #2 to the center of the screen.
- [U] key: Cancels the previous ‘C’ key (Eye #1). Undo can be executed multiple times.
- [I] key: Cancels the previous ‘V’ key (Eye #2). Undo can be executed multiple times.
- [R] key: Delivers a manual reward (initial pulse duration: 100 ms, juiceline: as determined in Reward of the main menu).
- [-] key: Decreases the pulse duration of the manual reward by 10 ms.
- [+] key: Increases the pulse duration of the manual reward by 10 ms.
d. Behavioral Summary & mlplayer
When the task is finished, a figure that summarizes behavioral performance pops up (left figure). Launch a trial replay tool, MonkeyLogic player (right figure), from this behavior summary and export each trial as a video clip. The summary figure and the player can be re-opened afterwards with the behaviorsummary and mlplayer functions.