Drifting Grating Stimulus¶
A drifting grating stimulus
Spatial frequency (cycles per degree)
Drift speed (degrees per second)
Direction of drift (degrees)
Starting phase at the grating’s center (degrees).
Only one of central_starting_phase and starting_phase may be specified. If both are omitted, the grating will behave as if starting_phase were set to zero. Because the interpretation of starting_phase is often unintuitive and generally unhelpful, it is recommended that grating definitions always include central_starting_phase.
NO, the current phase of the grating is computed from
speed, and the total time elapsed since the stimulus started
YES, the current phase is computed from the previous phase (i.e.
the phase when the stimulus was last drawn), spatial_frequency,
speed, and the time elapsed since the previous phase was computed.
This parameter is relevant only when the stimulus is live queued and the values of
and/or speed are changed while the stimulus is playing. Most
notably, if the parameter’s value is
NO, then changes to speed
will cause a discontinuous jump in phase. If the value is
changes to speed will be smooth, with no phase jump.
YES, the grating will function as a mask (similar to a Mask Stimulus). When used as part of a layer, “high”
regions of the grating (where the value is close to one) will allow
stimuli beneath it in the layer to show through, while “low” regions
(where the value is near zero) will partially or fully erase such
stimuli, exposing any stimuli beneath the layer.
When the value of this parameter is
alpha_multiplier, source_blend_factor, dest_blend_factor
source_alpha_blend_factor, and dest_alpha_blend_factor are
Note: For compatibility with existing experiments, the value of this
parameter can also be one of
gaussian, in which case it specifies the type of mask to apply to
the grating. However, this usage is deprecated, and new experiments
should use a Mask Stimulus instead.
YES, all grating values are inverted, e.g. high values become low, and low values become high
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.
Changes to the parameters source_blend_factor and dest_blend_factor can alter how (or if) the alpha multiplier is used.
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).
If omitted, the value of y_size is used. It is an error to omit both
x_size and y_size (unless fullscreen is
Vertical size (degrees).
If omitted, the value of x_size is used. It is an error to omit both
x_size and y_size (unless fullscreen is
Horizontal center position (degrees)
Vertical center position (degrees)
YES, the stimulus is sized to fill the display. In this mode, x_size, y_size, x_position, y_position, and rotation are ignored.
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.
YES, the stimulus will start playing automatically (as if by an implicit Play Dynamic Stimulus action) after it has been queued and Update Stimulus Display has been invoked. It will also stop playing automatically (as if by an implicit Stop Dynamic Stimulus action) after it has been dequeued and Update Stimulus Display is invoked.
Starting phase (degrees) at the “starting” edge of the grating. Exactly what constitutes the starting edge depends on direction, x_size, and y_size in a manner that is often unintuitive and generally unhelpful. Please use central_starting_phase instead.
Standard deviation of Gaussian mask.
The Gaussian mask is computed on a 2x2 square, centered at the origin, using the equation:
exp(-1.0 * (dist - mean) * (dist - mean) / (2.0 * std_dev * std_dev))
dist is distance from the center. The mask is then stretched
to cover a rectangle of x_size by y_size degrees. If the x and y
sizes are equal, then the mask is scaled by size/2 in both directions,
so std_dev has units of size/2 degrees.
Mean of Gaussian mask.
This value determines the radial offset of the Gaussian peak from the center of the grating. If non-zero, the peak will be a circle, rather than a point, and luminance will decrease both inside and outside the circle, producing a toroidal stimulus.
YES, the Gaussian mask includes a multiplicative normalization term (
NO, this term is omitted.
Allowed at top level:
Folder, Frame List Stimulus, Layer Stimulus, List Replicator, Movie Stimulus, Range Replicator, Stimulus Group