Stimulus Generators

Figure-Ground

The following Matlab functions/scripts can be used to generate pseudo-random edges for bipartite and multipartite stimuli in figure-ground experiments. The core function is fgEdgeGenerator.m . This generates the actual edge shape according to a set of parameters/arguments. The parameters can be used to determine the length of the edge, the number of "bumps" along the edge, the min/max bump height, smoothing, and other aspects of the edge shape. The function also outputs a Matlab structure containing statistics describing the generated edge. The fgBipartiteStimulusGenerator script serves as a way to generate bipartite stimulus images. This script calls the fgEdgeGenerator function.

OCTAVE COMPATIBILITY: These functions have been tested in Octave and do work but you may need to move all of the subfunctions within the fgEdgeGenerator function into separate m files in the Octave path. Octave is free software similar to Matlab in functionality.

IF USING, PLEASE CITE : Brooks, J.L. & Driver, J. (2010). Grouping puts figure-ground assignment in context by constraining propagation of edge assignment. Attention, Perception, & Psychophysics, 72 (4), 1053-1069

  • Matlab function, fgEdgeGenerator, generates a vector denoting a pseudo-random edge for use in automatically generating bi-partite or mutli-partite stimuli for figure-ground experiments. Examples at right. Edges can be smoothed or rectilinear. Read the help section of the Matlab script for more details on the parameters and output. Currently, the algorithm only approximates balanced convexity and equal area of the two sides.
  • This function does not directly generate images. See the script below which uses this function to generate bipartite images.
Smooth Edge
Recti-linear Edge

  • This Matlab script, fgBipartiteStimulusGenerator, uses the output of the edge generator script above to create bipartite figure-ground image files as output. It can also create biased versions for Short-Term Edge Matching (STEM) experiments. Images can have luminance or colour contrast edges and/or line edges. If you want to generate output images, this is the script to use. You must have fgEdgeGenerator.m (download above) in your Matlab path in order for this script to work.
Contrast edge
Line Edge

  • This Matlab script uses the output of the fgEdgeGenerator script above to create multipartite image files as output. These types of stimuli are used for the classic alternating black/white column figural judgements (see at right). but you can configure with any number of edges and colours. You can also configure with symmetric or repeated edges. You must have fgEdgeGenerator.m (download above) in your Matlab path in order for this script to work.
Multipartite figure-ground image with 5 unique edges (no symmetry or repetition) and even regions black and odd regions gray.

Convex Edge Generator (coming soon)

  • This script creates coordinates of an edge that is more convex on one side than the other.

Downloadable Figure-Ground Stimulus Databases

  • For those who do not have access to Matlab (but do consider Octave as a free alternative!) or just want to use previously generated stimuli, these databases were generated with the fgBipartiteStimulusGenerator script and are downloadable as a ZIP file. Each database includes a .mat file (edgeStats.mat) which contains statsistics of the edges and the script with settings used to generate the stimuli.
  • Bipartite Database (22 MB) - 1000 unique edges with 8 versions of each edge as PNG files. Examples of these different versions can be seen at right for the same edge. For colours different than those provided, you should use the fgBipartiteStimulusGenerator script (see above) to generate with your own parameters or use image processing software (e.g., Photoshop or Paint Shop Pro) to set up a batch process to change the colours in the images in this database. The left assigned and right assigned images are useful for the Short-Term Edge Matching (STEM) task which is an objective, reaction time measure of figural assignment. An example of this is described in Brooks & Driver (2010). You can select subsets of images which are more similar or more different in shape by using the edgeStats.edgeCorrelations data. See fgBipartiteStimulusGenerator script for more details.
BipartiteContrast Edge, Left Black
Left Assigned, White Line Edge
BipartiteContrast Edge, Left White
Right Assigned, White Line Edge
Bipartite White Line Edge on Black
Left assigned,Black Line Edge
BipartiteBlack Line Edge on White
Right Assigned, Black Line Edge