Protocol (Trial Mode)

This dialog page is essentially "mission control" for Trial mode. It presents the key controls for selecting, starting, and stopping a particular sequence of trials. Upon entering this mode, the user will typically choose a trial set to sequence, select a sequencing method, specify the file system path for storing the data files, and start the sequence.

** NEW - Sequencing trial subsets **  As of version 3.1.2, Maestro supports the notion of a trial subset, a collection of related trials within a trial set. A trial set, in turn, is now a collection of trial subsets and/or individual trials. With trial subsets comes a new way to sequence your trials during an experiment -- subset sequencing. If your trial set contains two or more (non-empty) subsets, you can specify how the subsets are sequenced during an experiment and how the trials in a given subset are presented. Subsets may be presented in order or randomly, or subset sequencing may be turned off altogether. In the latter case, all the trials in the set -- including those ensconced in subsets -- are treated as a single group of trials. If you use the new subset sequencing feature, keep in mind the following: 

If you are NOT interested in using the subset sequencing feature, then simply continue to use Maestro as before. Don't introduce any trial subsets into your trial sets, and subset sequencing will always be disabled.

Setting up the trial sequence

SET-- This combo box displays the name of the set of trials to be sequenced. The dropdown list includes an entry for each trial set currently defined under the Trials node in the experiment document tree. Obviously, trial sequencing cannot begin until a trial set is chosen; if the current selection is NONE, then the Start button will be disabled.

TRIAL -- This combo box displays the name of a trial in the currently selected trial set. The dropdown list will include the entry NONE, plus the names of all the trials in the selected set. If a trial is part of a trial subset, then the name of the subset appears before the trial name: "subset : trial". Use the combo box to select the one trial that will be presented repeatedly in the Current Trial and Current Trial NOFIX sequencing modes. During a trial sequence in any of the other sequencing modes, the combo box will display the name of the trial that is currently running.

"Protocol" dialog panel in Trial Mode

Sequencing -- Use the two combo boxes in this control group to specify the Subsets sequencing mode and the Trials sequencing mode. If the selected trial set contains no trial subsets, then the Subsets combo box will be disabled. Otherwise, you can choose among three alternative subset sequencing modes: OFF, Ordered, and Randomized. As the names suggest, the Ordered mode will present the subsets in the same order they appear under the parent trial set, while Randomized mode will present the subsets randomly (but every subset is presented once before a subset is presented a second time!).

Maestro offers seven different ways to sequence trials, but not all of them are available when subset sequencing is enabled. If you choose a trial sequencing mode that is not compatible with subset sequencing, then the Start push button will be disabled if the subset sequencing mode is anything other than OFF. Here's a brief description of the various trial sequencing modes:

A trial may not run to a completion if a serious error occurs, if the animal did not satisfy fixation requirements enforced during the trial, or if RMVideo detected one or more duplicate frames during the trial. When an error occurs, the trial sequence is terminated. When fixation is lost or a duplicate frame is detected, sequencing continues; the trial may or may not be repeated -- in accordance with the rules for the various sequencer modes. 

Except for Ordered (Repeat), all sequencer modes come in a NOFIX version -- in which fixation checking is suspended and all trial presentations run to completion regardless of what the animal does. A NOFIX sequencing mode might be used for a set of trials that do not require the animal to fixate on a particular target. The NOFIX modes are also helpful when you are designing experiments -- to verify that each trial is doing exactly what you intended.

Treatment of RMVideo duplicate frames during a trial

Prior to Maestro 4.0.5, an RMVideo duplicate frame was treated as an error, and the trial sequence was terminated. This was because duplicate frames are rare, undesirable, and may be symptomatic of a more serious problem. However, testing Maestro trials on a 144Hz RMVideo monitor showed that duplicate frames may occasionally occur at the higher refresh rates, even using an up-to-date graphics card and even if the trials are relatively simple. To support higher RMVideo refresh rates in the future, Maestro -- as of v4.0.5 -- continues the trial sequence when a trial aborts on a duplicate frame detection, and the trial is repeated (or not) as appropriate to the current sequencer mode. Furthermore, you can configure Maestro to "tolerate" up to three duplicate frames during a trial without stopping it -- simply check the Allow RMVideo Repeat Frames item in the Options menu. If this option is enabled and a trial with 3 or fewer repeated frames is completed, timing information on the duplicate frame events is stored in the data file's header.

EyeLink errors during trial sequencing

Prior to Maestro 4.2.1 (Apr 2023), an error associated with communications between Maestro and the EyeLink eye tracker system was treated as an error, and the trial sequence was terminated. EyeLink errors do occasionally occur, and terminating the trial sequence impacts the ongoing experiment because it is difficult to return to "where you left off". As of version 4.2.1, an EyeLink error terminates the running trial, but trial sequencing continues in accordance with the current sequencer mode. If the error repeats, the user can Pause rather than Stop trial sequencing, attempt to address the issue with the tracker, then Resume sequencing.

Ignore threshold -- Often during a long sequence of trials, the animal will sometimes get bored or distracted and thereby "ignore" one or more trials, which will abort the moment Maestro enforces the trial's fixation requirements. In other trials, the animal may follow the fixation target initially but then lose track of it later on. The Ignore threshold parameter was introduced as a means of distinguishing trials that the animal simply ignored from those that it genuinely attempted. The user enters a time in milliseconds in the numeric edit control; any integer in [0 .. 9999] is allowed. If a trial was aborted because the animal lost fixation, then Maestro considers the trial "ignored" if the trial's elapsed time was less than or equal to this threshold; else, it was "attempted". A threshold of 0 ms (the default) will treat all trials as "attempted". The Attempted trial counter displays the number of genuinely "attempted" trials since the last time the counter was reset, while the #Trials counter displays the total number of trials presented. The difference between these two counters should be the number of trials that were "ignored".

Inter-trial Delay : This parameter sets the time delay between trial presentations, in milliseconds. A nonzero delay may be necessary because having the next trial start immediately after the previous one can confuse the subject, particularly if the previous trial aborted prematurely because fixation constraints were violated. The default value is 0 ms; the edit control accepts integer input in the range [0 .. 2000] ms.

Saving data files

To save trial data to file, be sure to check the Save? checkbox near the bottom of the Protocol tab page. Checking this box will enable the neighboring "file path" control. This customized edit control displays the full file-system pathname for the next data file to be written; thus, the file displayed in the control usually does not yet exist. Note the embedded browse button at the right end of the edit control. To change the file path, you can click on this button to open a standard Windows file dialog and browse the file system in search of the desired destination. Alternatively, you can type the path directly into the edit window. In either case, Maestro verifies that the destination directory exists; if it does not, the trial file path reverts to the previous valid entry. Furthermore, the filename must end in a 4-digit numeric extension; Maestro increments this extension each time a file is saved to generate the filename for the next trial. If the filename entered into the file path control or the popup file dialog does not have a 4-digit extension, Maestro will automatically generate one (replacing the existing extension, if there was one). In addition, if the file already exists, it will increment that extension until it gets to ".9999" or it finds a filename that does not yet exist in the specified destination directory.

As a convenience to users, Maestro stores the current destination directory in the user's registry when it quits. The next time it starts up, it will check the user's registry for this "most recently used" trial data file directory and initialize the file path control accordingly.

To the right of the file path control is another checkbox labelled Rec spikes?. If this box is checked, Maestro will sample the signal on analog input channel #15 at 25KHz and include the high-resolution data stream in the trial data file. AI<15> is typically reserved to monitor the amplified signal from an extracellular electrode -- in other words, the raw "spike waveform" signal that's fed into a window discriminator to detect the occurrences of action potentials. This option is used when recording neural units with more complex spiking profiles, or when the investigator wishes to do spike sorting offline in order to isolate multiple units recorded on a single electrode.

Saving files across a mapped network drive

Many users prefer to save their Maestro data files across a Windows "mapped network drive" to their home directory on a server connected to a local intranet. All data files are created and written by Maestro's hardware controller. This controller runs as a real-time process under RTX, and RTX does not support file I/O across a remote drive. To get around this limitation, Maestro instructs the hardware controller to write the data to a "shadow file" on the local disk. After the controller closes the file, Maestro (running in Win32 "user" mode) can move the local shadow file to its intended destination on the mapped network drive. Shadow files are put in the directory $LocAppD\Maestro\shadow\$DATE, where $LocAppD is the current user's local application data folder on the system drive (e.g., C:\Users\username\AppData\Local) and $DATE is the date when Maestro was launched. The filename is the same as that entered by the user. If Maestro is unable to move a shadow file at any time, the user is notified of the error and the file is left in the shadow directory so that the user can recover it. When Maestro exits, it normally will attempt to remove the shadow directory it created at startup. However, if a shadow file copy failed at any point during runtime, the shadow directory is left untouched. In this case, it is the user's responsibility to copy the orphaned shadow files to their permanent location before running Maestro again. If the user were to run Maestro again on the same date, it will use the same shadow directory at ..\$DATE. If no shadow file copy faults occur this time around, on exit it will remove that directory, including the files left there previously. 

[NOTE: The shadow directory location is new for Maestro 4. For Maestro 3.x and earlier, the shadow directory was located in the Maestro installation directory: $HOME\shadow\$USER\$DATE, where $USER is the current user's username.]

Saving files across a mapped network drive can introduce delays between consecutive trials presented during Trial mode. When the shadow-file operation was first introduced, some users observed delays as much as 10 seconds or more on occasion. Such delays are unacceptable, since they can confuse the animal subject. To get around this problem, Maestro now queues the shadow-file copy operations in a separate background thread. This should eliminate the long delays when the network file copy is slow, but the background thread may impact the responsiveness of the Maestro GUI. Also, the background file I/O could fail if the network goes down briefly or exhibits slow throughput over an extended period of time. For this reason, users are discouraged from saving data files across a remote drive. Instead, save files to a folder on the local disk, then move the files to the remote drive when the experiment is over. If saving across a remote drive is a must -- e.g., if it is important to analyze data files on the fly during an experiment -- be prepared for some quirky behavior from Maestro! Alternatively, consider creating a shared folder on the local disk and write all data files to that directory. Then, a program running on a remote computer can monitor the contents of that folder and, when a new file appears there (written by Maestro), it can move the file to the desired location on network.

Starting and stopping the sequence

After selecting a trial set and sequencing configuration and setting any other parameters as needed on the Protocol and Other Params tabs, press the Start button to initiate the trial sequence. The button's label changes to Stop, and trial sequencing begins. You will note that most controls on both this tab and the other tab pages are suddenly disabled -- reflecting the fact that these parameters should not be changed while a trial sequence is in progress. All of the commands in the top-level File menu are disabled as well; file I/O operations are not allowed since Maestro and its hardware controller are extremely busy during a trial sequence. It also makes little sense to open a different experiment document while actively running trials drawn from the current document! You can, however, still make changes to the current experiment, even to the trials being sequenced -- but doing so is NOT recommended. To stop an ongoing trial sequence, press the Stop or Abort buttons. As the name implies, Abort will terminate the trial sequence immediately, aborting the trial that was in progress when the button was pressed. Stop, on the other hand, waits for the current trial to finish. While waiting, the button is disabled and its label reads !!!WAIT!!!. Alternatively, using the controls in the Auto-Stop group, you can configure a trial sequence to stop after a specified number of trials or trial blocks have been completed. The controls are self-explanatory. Keep in mind that the notion of a trial block exists only in the Ordered and Randomized trial sequencing modes. It the Auto-Stop criterion is After N trial blocks and the sequencing mode is neither Ordered nor Randomized, then a single trial is interpreted as a trial block. Also, note that the Stop and Abort buttons still work even if the Auto-Stop feature is enabled. In some situations it may be useful to pause trial sequencing for a short time -- e.g., to give the subject a brief respite, to attend to a technical problem with the laboratory apparatus, or to change certain parameters based on what you have observed thus far. When the Pause button is pressed, the trial in progress runs to completion, the button is relabeled Resume, and the trial sequence is "paused". While paused, the user can modify settings on the Fix/Reward and Video Display tabs and some settings on the Other Params tab. Pressing the Resume button resumes trial sequencing from where it left off. While paused, the user can always choose to Stop or Abort the trial sequence.

Monitoring progress

During a trial sequence, eye and fixation target position are updated continuously (at 30Hz, roughly speaking) on Maestro's Eye-Target Position display. At the end of each trial, the Data Traces panel is updated to show the data collected during that trial. If any trials in the sequence include tagged sections, the Spike Histograms panel will display the cumulative spike time histograms for all such sections. For more information on these display panels, see Monitoring Experiments

The Protocol tab itself includes several summary statistics that give the investigator a general idea of how the subject is performing. The total number of trials presented thus far (since the last time the statistic was reset, that is!) is shown in the read-only edit window next to the #Trials pushbutton. Press the button at any time to reset the statistic. Similarly, #Blocks displays the number of trial blocks completed thus far, Attempted is the number of trials that were not "ignored" by the subject (in accordance with the Ignore threshold), and Completed is the number of trials that were successfully completed.

Some additional statistics are available on the Statistics tab, which is unique to Trial mode. This simple tab page holds a single read-only table that, for all trial sequencer modes except Chained and Chained NOFIX --  lists the names of the individual trials in the currently running (or last finished) trial sequence, the number of times each trial has been attempted -- i.e., not ignored, as determined by the Ignore threshold --, and the number of times each trial was successfully completed. This table may help the investigator monitor the animal's progress during a long randomized sequence of trials.

For the Chained sequencer modes, the table has a different layout, as shown in the screenshot above. The different trials in the sequenced set are listed in the column headers, and row N displays the number of times a "success chain" of length N has occurred for each trial. A "success chain" is simply the successful completion of 1 or more consecutive presentations of the same trial. Such a chain is broken when the sequencer is stopped or paused or, naturally, whenever the identity of the trial presented changes. Since a success chain of length 10 will increment the incidence count for success chains of length 1 through 9 as well, the incidence counts will decline as the chain length increases. The incidence count is only shown for chain lengths up to 10; row 11 shows the incidence count for all success chains of length 11 or greater. Finally, the last two rows show the total # of trials attempted and successfully completed, as described above.

The table is reset each time a new trial sequence begins.