Parametric Shape Stimulus¶
A user-defined, two-dimensional shape stimulus.
The shape is defined by a list of vertices. By default, the outline of the shape is computed via a cubic B-spline approximation, for which the vertices serve as control points, resulting in a smooth edge. However, if spline_resolution is set to zero, the provided vertices are used as-is and connected with straight line segments, producing a polygon. Once the shape’s outline has been established, the interior is filled with the specified color.
Note: The outline of the shape is determined when the stimulus is loaded. To change the value of vertices or spline_resolution while the experiment is running, you must unload the stimulus, change the desired parameter, then reload the stimulus.
The coordinate grid on which the shape’s vertices lie is a square with center given by vertex_coord_center_x and vertex_coord_center_y and edge length given by vertex_coord_range. If any of these parameters is omitted, its value is inferred from the other parameters (if present) and the bounding box of the shape, i.e. the smallest rectangle that encloses the entire shape. Note that if spline_resolution is non-zero, the bounding box is determined from the spline approximation of the shape edge, not the raw vertices.
[[-2, -2], [0, 2], [0, 0], [2, -2], [0, -1], [-2, -2]]
Set of points that define the shape, in arbitrary coordinates (see above). Must be a list of two or more sub-lists, with each sub-list containing two numbers.
Number of points in the cubic B-spline approximation computed from vertices. Higher values will produce a smoother edge.
Must be greater than or equal to zero. If zero, no spline approximation is computed, and the provided vertices are connected with straight line segments.
x coordinate of the center of the vertex coordinate grid (see above for details)
y coordinate of the center of the vertex coordinate grid (see above for details)
Edge length of the vertex coordinate grid (see above for details)
Number of pixels at the edge of the stimulus rectangle (i.e. the region specified by x_size, y_size x_position, y_position, and rotation) that are not drawn on. Must be a floating-point number greater than or equal to zero.
If parts of the shape at the edge of the vertex coordinate grid appear rough or truncated, increasing the number of margin pixels may eliminate the issue.
YES, anti-aliasing will be used to smooth the rendered edges of the shape
Maximum horizontal size (degrees).
If omitted, the maximum horizontal size is set to the value of x_size when the stimulus is loaded.
Maximum vertical size (degrees).
If omitted, the maximum vertical size is set to the value of y_size when the stimulus is loaded.
The color of the stimulus, expressed as a comma-separated list of red, green, and blue components. Each component may be described by any valid expression, but the expression must result in a value between 0 and 1 (inclusive).
By default, the alpha multiplier controls the transparency of the
1.0 is fully opaque, while
0.0 is fully tranparent.
Source blending factor.
The parameters source_blend_factor, dest_blend_factor, source_alpha_blend_factor, and dest_alpha_blend_factor provide detailed control over how the color components and alpha multiplier of each fragment of the stimulus (the “source”) are combined with the color and alpha values already present in the framebuffer (the “destination”), which in turn result from blending the stimulus display background with any stimuli drawn beneath the source stimulus. These parameters correspond directly to the four arguments of the OpenGL function glBlendFuncSeparate. Please refer to that function’s reference page for explanations of the different blend factor options.
Note: Irrespective of the blend factors used, the blend equation
Destination blending factor. Accepts the same values as source_blend_factor.
Source alpha blending factor. Accepts the same values as source_blend_factor.
If omitted, the value of source_blend_factor is used.
Destination alpha blending factor. Accepts the same values as source_blend_factor.
If omitted, the value of dest_blend_factor is used.
Horizontal size (degrees).
Vertical size (degrees).
Horizontal center position (degrees)
Vertical center position (degrees)
Controls when the stimulus is loaded. If
no, the stimulus is loaded at experiment load time. If
yes, the stimulus is loaded the first time it is queued. If
explicit, the stimulus must be loaded explictly with Load Stimulus.
Name of the display on which the stimulus will be presented. If omitted, the default display (if available) will be used.
Allowed at top level: