Running a Task

Loading a Conditions/Userloop File

To start a task, either a conditions file or a userloop file should be loaded. 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, not a text file.

Both files can be loaded by clicking the [Load a conditions file] button. The file-open dialog shows *.txt files only, by default, so you need to change the extension type to choose a userloop function (*.m). Alternately you can 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 and you can customize how many trials to run in each block.
  • "Blocks to run" and "First block to run" allow you to run only a subset of the defined blocks and choose which blocks to run very first.
  • 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" let you decide when the task will stop. The task will be paused whichever between them comes first.

Additionally you should 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.

Pause Menu

This pause menu appears when the RUN button is hit or when the task is paused. In this menu, the following options are available. You can use hotkeys 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

Control Screen

  1. 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. You can display user-defined dynamic texts during trials here (see the dashboard runtime function).
  2. Time line of events: Too many (~several hundreds) events may make it really slow to update this figure. If such a thing happens, you can stop updating this figure by setting TrialRecord.DrawTimeLine false.
  3. Trial counts and results: Trial results are number-coded as in the trialerror runtime function. The zoom level is adjustable, only while the task is paused.
  4. User text/warning panel: Texts sent by the 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 shown up immediately.
  5. 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 here. 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). You can undo multiple times.
  • [I] key: Cancels the previous ā€˜Vā€™ key (Eye #2). You can undo 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.

Behavioral Summary & mlplayer

When the task is finished, a figure that summarizes behavioral performance is popped up (left figure). You can 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.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.