Segment Table

The heart of a trial is the segment table, which appears as a spreadsheet-like grid of mostly numerical data occupying the bottom two-thirds of the Trial Editor panel. It is this table which lists all targets participating in the trial and defines their trajectories on a segment by segment basis.Each segment is characterized by a number of attributes that determine the duration of the segment, set fixation requirements for that segment, and so on. These are followed by a list of trajectory parameters for each target, which define that target's motion during the segment. Note that there are separate parameters for target window velocity and acceleration vs target pattern velocity and acceleration. 


Trial segment table

Most XYScope and RMVideo targets have both a bounding window and a completely independent pattern -- such as a random-dot pattern or a sinusoidal grating. Other target types, like the XYScope Spot/Rect Dot Array or the RMVideo Solid Bar/Line target type, have no separate pattern component; for such targets, pattern trajectory information is ignored.Pattern motion is specified with respect to the target window. Prior to Maestro v2.7.0 (July 2011), XYScope target pattern motion was defined with respect to the display screen, a fixed frame of reference. In Maestro 2.7.0, the XYScope target implementations were modified so that pattern motion is now defined with respect to the target window -- which is how the RMVideo targets have always behaved since they were introduced in version 2.5.0. (There remains one exception to this rule: the RMVideo Random-Dot Patch target when its Pattern motion WRT screen? flag is set.)

Segment parameters described

Min & Max Duration (ms). To prevent a trained subject from predicting a fixation target's trajectory, the experiment designer often will want to randomize the time at which the target begins moving. Maestro allows the user to randomize the duration of any segment by specifying a different minimum and maximum segment duration. Before the trial begins, the program randomly chooses a duration from the specified range. As of V3.3.0, any of the trial's random variables (RV) can be assigned to the segment duration; by design, both the minimum and maximum duration are assigned to the same RV, and that RV will govern the actual segment duration used during each successive presentation of the trial.

XY Frame Period (ms). The interval between "frame updates" of the XYScope. Any even-valued integer in [2..256] milliseconds is a valid frame period. Typical values for this parameter are 2 or 4 milliseconds. If the trial animates several XYScope targets at once, or just one target containing many dots, a slightly larger interval may be required to give the XYScope controller enough time to paint all the dots; otherwise, the trial may abort on an "XYScope frame drop" error. Frame periods > 16ms may be used in apparent motion studies. Note that, to avoid synchronization problems with the XYScope controller, Maestro forces segment duration to be an integer multiple of the XYScope frame period for that segment.

RMV Sync. (As of Maestro 4.0.0)  Since RMVideo's refresh rate is significantly slower than Maestro's 1-ms time resolution in Trial mode, there is a delay between the start of a trial segment as programmed in Maestro and the actual display of the first video frame for that segment. The delay is both software-dependent and hardware-dependent (e.g., display "input lag"), so it is indeterminate and likely to vary from trial to trial. To provide a mechanism for more precisely measuring when the first video frame of any trial segment was actually displayed, a "vertical sync" flash may be presented in a small spot at the top-left corner of the RMVideo display. The size of the spot and the duration of the flash are RMVideo display settings; see the Video Display page for more information. To trigger the flash for any trial segment, simply turn ON the RMV Sync flag (default is OFF). Make sure that the spot size is large enough and the flash duration long enough to adequately stimulate the photodiode assembly you attach to the RMVideo display.

Avoid RMV Sync on segment 0

We do not recommend enabling the RMVideo vertical sync flash for the first segment of a trial. The reasons for this are somewhat technical.

Unlike a typical video game, RMVideo is required to update the screen every refresh; otherwise, RMVideo falls behind the Maestro timeline -- you get a "frame drop". To maximize performance, Maestro sends the frame update record for frame N at the beginning of frame N-2. This ensures that the update record is ready so that RMVideo can spend an entire refresh period (while frame N-1 is being displayed) to prepare frame N on a backbuffer.

Before the start of the trial, Maestro sends RMVideo the frame update records for the first two video frames. It then WAITS for RMVideo to signal that it has begun displaying frame 0 BEFORE it starts the data acquisition sequence. As a result, it is likely that a vertical sync flash on segment 0 will occur before it can be time-stamped by Maestro!

Fixation Targets #1 & #2. Designates the fixation targets for the segment. The second fixation target applies only to the two-choice special operations selByFix, chooseFix, and switchFix. In all other situations, the second target is ignored. The designated fixation target will be one of the targets participating in the trial, or NONE. In the latter case fixation is not enforced.

H,V Fixation Accuracy (deg). These parameters define a rectangular window around the current position of the designated fixation target (if there is one). If the target position is (Tx, Ty) and the fixation accuracy is (Fx, Fy), then the fixation window is given by (Tx ± Fx, Ty ± Fy). As long as eye position is within this window, the subject is considered to be fixating on the target. Accuracy is specified as a floating-point value >= 0.1deg, with up to two digits after the decimal point.

Grace (ms). When a fixation target comes on or is suddenly displaced in position at the beginning of a segment, the subject is often given a short time to "reacquire" the target. This "grace period", during which fixation checking is suspended, can be any non-negative integer value. If it is zero, then fixation is enforced during the entire segment. On the other hand, if the grace period is greater than or equal to the segment duration, then fixation checking is suspended for the entire segment; (but a really long grace period does not "carry over" to the next segment!).

Binocular Fixation Checking with the Eyelink

[New in Maestro v4.2.0] When enforcing fixation requirements during a trial, Maestro verifies that the subject's current eye position (HGPOS, VEPOS) is within the specified fixation window around the current position of Fixation Target #1. However, binocular fixation checking is enforced under the following conditions:

In this scenario, fixation requirements are satisfied only if the left eye is inside the fixation window for Fixation Target #1 and the right eye is inside the fixation window for Fixation Target #2. The same fixation window (H,V Fixation Accuracy) is used for both checks.

Mid-trial Reward?. This flags enables or disables the delivery of a mid-trial reward during the segment. The default value is OFF, since the mid-trial rewards feature is used in relatively few Trial-mode experiments.

Marker pulse. At the beginning of each segment in a trial, Maestro can deliver a brief pulse on any of the output channels DO<0> to DO<10> on the digital I/O event timer device. [DO<11> is reserved for synchronizing with the external Plexon or Omniplex neural data acquisition system]. This parameter selects the channel # for the marker pulse; if NONE, then no marker pulse is generated. Typically, a researcher will use one or more pulses to mark the times at which target motion begins and ends during the trial. The time of occurrence of each pulse can be recorded in the data file -- just connect the relevant digital output channel to one of Maestro's digital inputs. For simplicity's sake, users typically connect DO<n> to DI<n>.

Check response?. In a typical test trial during a staircase sequence, Maestro needs to check the subject's response at some point in the trial. Use this flag to select one or more trial segments during which Maestro monitors the correct and incorrect response channels. In any other trial sequencing mode, this parameter has no effect.

ON/OFF flag. Except for the animal Chair, any target may be turned on or off during any trial segment. What happens if a target is programmed to move while it is turned off? It will continue to move!

Velocity Stabilization. Some experiments are designed to "open the pursuit loop" by stabilizing a visual pursuit target on the retina for a specified period of time; other experiments may choose to stabilize a secondary target rather than the fixation target. Essentially, by taking into account any movement of the eye, the program ensures (to the extent possible) that the target moves, with respect to the eye's frame of reference, in accordance with the parameters in the trial segment table. Maestro supports velocity stabilization on a per-target, per-segment basis via the parameters in the segment table row labelled Velocity Stabilization. The stabilization mode is listed in the left-hand column: OFF disables the feature for the given segment and target, H+V enables stabilization of both components of the target's motion during the segment, while H ONLY and V ONLY enable it for only one of the components. The right-hand column specifies the "snap-to-eye" flag, which is relevant only when stabilization is being turned on during a segment (and was OFF during the previous segment). If the w/SNAP flag is set, then the target will be "snapped" to the eye's position at the start of the segment. Implementation Constraints: The target to be stabilized must be a RMVideo or XYScope target. It is not recommended that velocity stabilization be enabled in a trial that employs one of the saccade-related special operations. Although this last constraint is not currently enforced, Maestro has not been tested in this situation and unexpected behavior may occur.

NOTE: Prior to Maestro v2.5.2 (Jan 2010), velocity stabilization was not permitted for selected RMVideo and XYScope target types. While these restrictions have been removed, users should be aware that some targets may not work as expected if velocity stabilization is in effect. For example, if a target has a finite dot life expressed in degrees travelled, velocity stabilization is likely to interfere with the expected behavior of the target; a large saccade will cause all the dots to travel a relatively large distance, so all of their dot lives will be reset during the same display frame -- and so the dots will "recycle" at the same time from then on! For the optic flow field targets on both the XYScope and RMVideo, only the target window motion is compensated, not the flow velocity (after all, this is motion perpendicular to the screen). For both XYScope and RMVideo targets, stabilization is achieved simply by adjusting the target window trajectory because -- with the exception of the RMVideo Random-Dot Patch target with the Pattern motion WRT screen? flag set -- a video target's pattern velocity is specified with respect to the target window, NOT the screen.

Window Pos H,V (deg), ABS/REL flag. Use these parameters to displace the target's position at the start of a segment -- either ABSolutely, or RELative to the target's position at the end of the preceding segment. Does not apply to the Chair target, which cannot be instantaneously repositioned.

Window Vel H,V (deg/s). Specifies constant target velocity during the segment. Can be modified by a velocity perturbation.

Window Acc H,V (deg/s2). Specifies constant target acceleration during the segment. Ignored for immobile targets.

Pattern Vel H,V (deg/s). Specifies constant target pattern velocity during the segment. Applicable only to XYScope and RMVideo target types that possess an independent target pattern. Can be modified by a velocity perturbation.

Pattern Acc H,V (deg/s2). Specifies constant target pattern acceleration during the segment. Applicable only to XYScope and RMVideo target types that possess an independent target pattern.

NOTE that the H and V components of target window position, velocity, or acceleration may be assigned to one of the trial's random variables. The same goes for the H/V components of the target pattern velocity or acceleration.

A few of the XYScope and RMVideo target types do not neatly fit into the target "window plus pattern" motion supported by the segment table:

[NOTE: The same caveats apply to the new pattern acceleration components for these non-standard extended video targets.]

Intra-trial tagged sections

The segment table is actually two tables. A single-row grid above the segment table -- the partitions grid -- serves as a column header for the table, and as the means for creating and editing a trial's tagged sections. A tagged section is a contiguous range of segments within a trial to which a brief descriptive tag is assigned. The idea here is to provide a means of partitioning a longer trial into a set of "mini-trials", each of which serves a different purpose -- e.g., testing a neural unit's response to a patch target moving in one of 8 different directions. A trial can have as many tagged sections as it has segments -- i.e, each segment can be a tagged section. However, no two tagged sections in a trial can overlap or have the same name, and section tags are limited to 17 characters or less.

The tagged sections feature was originally introduced to facilitate receptive-field characterization of units recorded in the medial temporal (MT) region of the brain. Rather than creating eight short trials to record a unit's response to eight directions of motion, the experimenter can now create one trial that tests all 8 directions in one go (in practice, the trial set might include several trials, and the order in which the 8 test directions are presented would be different for each trial). Tagged sections make it easy to parse the data into the 8 different pieces, one for each direction tested. The tag name and segment range spanned by each section are stored in the trial data file. Analysis software can use this information to parse the individual sections from the trial data. Furthermore, during trial sequencing, Maestro builds and displays spike time histograms for each tagged section found among the trials in the sequenced trial set. These histograms are displayed in the Spike Histograms panel.

Using the segment table

The segment table is by far the most complex control on Maestro's user interface. Segment parameters are displayed in the individual cells of the grid. They fall into two distinct categories: numeric or multiple-choice.

To edit a numeric parameter, simply double-click on the cell. An "in-place" edit control appears on top of the cell, and the parameter's current value is selected in the edit window (the in-place control will also appear automatically if the user starts typing and the focus is already on a grid cell containing a numeric parameter). Type in a new value, then hit Enter to extinguish the in-place control and enter the new value; Maestro checks the value and auto-corrects it as necessary. The edit control restricts keyboard input to the numeric digits, the minus sign (if negative values are permitted), and a single decimal point (unless the parameter must be an integer). The standard text cut, copy and paste operations are supported; of course, you cannot paste non-numeric input into the numeric edit window. Pressing the Esc button will cancel the operation and hide the in-place edit control; clicking outside the control has the same effect as pressing the Enter button.

To edit a multiple-choice parameter (including boolean values!), double-click on the cell to invoke a different kind of in-place control. In this case, a dropdown combo box covers the cell, with the dropdown list initially visible. Use arrow keys or the mouse to select a new choice from the list, then hit Enter to extinguish the control. Alternatively, you can right-click on the cell to advance to the next entry in the multiple-choice list; if the current value is the last entry in the list, it wraps around to the first entry. With the Shift key depressed, a right-click will change the value to the previous entry in the choice list.

On assigning a random variable to a segment table parameter. As of V3.3.0, you may define up to 10 different random variables in a trial, x0-x9, and assign them to selected parameters (segment duration, target trajectory components) in the segment table. These parameters behave like a numeric parameter when the current value is a simple constant; however, when an RV is currently assigned to the parameter, it behaves like a multiple-choice parameter. To reflect the RV assignment, the variable name "xN" appears in the cell, and the cell's background is a light green instead of white or gray. To switch between the two "states", right-click on the corresponding cell. If the parameter is currently set to a numeric constant, it will be assigned to x0; continue right-clicking to advance through the set of 10 RVs in order. If the current RV assigned is x9, another right-click will restore the parameter to a default numeric value. Holding down the Shift key while right-clicking will decrement rather than increment the RV index. You also edit the parameter as described above using an in-place control; when the current value is numeric, the in-place control is a numeric text field; when the current value is an RV assignment, the in-place control is a combo box with the choice list: x0, x1, x2, ... , x9, const.

Take care as you define your random variables and assign them to parameters in the segment table. Be aware of the range of values generated by an RV and ensure that range "makes sense" for the parameter to which it is assigned. For example, it makes no sense to assign a normally distributed RV with a negative mean to segment duration, which can only be positive. In this scenario, if the RV's current "variate" is negative, Maestro will run the trial but force that segment duration to zero. Also note that Maestro does not stop you from assigning an undefined RV (type = "UNUSED") to a segment table parameter. However, when you try to run the trial sequence, it will detect the issue, abort the sequence, and report the problem in the Message Log. The same action is taken if a FUNCTION-type random variable is assigned to a parameter, and that function cannot be evaluated  -- such as x2 = 1/x0, where x0 = 0.

You can use the keyboard instead of the mouse to navigate around the segment table. Click on any editable cell in the grid and note how it is highlighted with a border rectangle to distinguish it as the "focus cell". The arrow keys move the focus up, down, left or right in the grid (but without wrapping around the edges of the table). The Tab key is similar to the right arrow, except that it will "wrap around" to the next row if the current focus is on the last column. The Home key moves the focus to the first column of the current row, while the End key moves it to the last column. Similarly, the PgUp key moves the focus to the top row of the current column, while the PgDn key moves it to the bottom row. Some of these navigation keys may be used to complete an in-place edit operation on one cell and then initiate an in-place operation on a nearby cell. The Tab key will move the focus to the corresponding cell in the next segment, while Ctrl-arrow key will move to the cell above, below, left or right of the cell that was just edited. These navigation mechanisms provide a way for the user to edit multiple parameters in the segment table without using the mouse.

A special mouse gesture is required to define a tagged section on the trial. Hold down the Shift key while left-clicking on two cells in the partitions grid. After the first click, the cell is highlighted in blue. After the second click, the selected range of cells is merged into one cell representing the tagged section. An in-place edit control appears, allowing you to change the tag name provided for the new section. Upon pressing the Enter key, the section name is updated. As shown in the earlier screenshot of a sample segment table, a single cell spans the segments in the tagged section, its background is a yellow hue instead of white, and the cell text shows the tag name along with the range of segment numbers spanned (e.g., "mySection [1:3]"). To rename an existing tagged section, simply double-click on the corresponding cell to invoke the in-place editor and type in the new name.

Most other operations on the segment table involve the use of a dedicated context menu. To invoke the menu, right-click on any cell in the partitions grid, or any cell in the first column of the main segment table. The context menu lists all commands available; the exact content of the menu will depend upon the cell -- the "context cell" -- that was under the mouse cursor when the right-click occurred.

Modification Mode. Normally, any operation on the segment table is atomic in nature: changing a segment parameter in one segment of a trial has no effect on that parameter in other segments, and adding a target or segment to a trial has no effect on the other trials in the trial set. However, the Trial Editor offers a number of different "global" modification modes that can propagate an editing operation across all the segments in the loaded trial, or even across all trials in its trial set. Using these global modification modes can help speed up the process of preparing a set of trials for an experiment, but be sure to use them with care. If you're trying them out for the first time, it's a good idea to make a copy of your experiment document before you start making changes.

The current modification mode is always displayed in the top-left cell of the segment table; whenever one of the global modification modes is in effect, the background of the cell is painted red to alert the user to that fact. Note the accelerator keys assigned to each of the modification modes; these shortcut keys are recognized only when the segment table has the keyboard focus.

The last three modification modes are very powerful, since they will propagate a change in any trial parameter across all or some trials in the set -- as though you are modifying multiple trials in a set at the same time. However, these modes must be used with great care to avoid unintended changes across the entire trial set. Currently, operations involving tagged sections and changes to the trial's random variables list cannot be propagated across trials.