contrast_contrast#

contrast_contrast stimulus example

You can find an interactive version of this example here

stimupy.stimuli.checkerboards.contrast_contrast(visual_size=None, ppd=None, shape=None, frequency=None, board_shape=None, check_visual_size=None, target_shape=None, period='ignore', rotation=0.0, intensity_checks=(0.0, 1.0), tau=0.5, alpha=None, round_phase_width=True)#

Contrast-contrast effect on checkerboard with square transparency layer

Checkerboard version of the contrast-contrast illusion (Chubb, Sperling, Solomon, 1989), as used by Domijan (2015).

Parameters:
  • shape (Sequence[Number, Number], Number, or None (default)) – shape [height, width] in pixels

  • ppd (Sequence[Number, Number], Number, or None (default)) – pixels per degree [vertical, horizontal]

  • visual_size (Sequence[Number, Number], Number, or None (default)) – visual size of the total board [height, width] in degrees

  • board_shape (Sequence[Number, Number], Number, or None (default)) – number of checks in [height, width] of checkerboard

  • check_visual_size (Sequence[Number, Number], Number, or None (default)) – visual size of a single check [height, width] in degrees

  • targets_shape (Sequence[Number, Number], Number, or None (default)) – number of checks with transparency in y, x direction

  • intensity_low (float, optional) – intensity value of the dark checks, by default 0.0

  • intensity_high (float, optional) – intensity value of the light checks, by default 1.0

  • tau (Number) – tau of transparency (i.e. value of transparent medium), default 0.5

  • alpha (Number or None (default)) – alpha of transparency (i.e. how transparent the medium is)

  • round_phase_width (Bool) – if True, round width of bars given resolution (default: True)

Returns:

dict with the stimulus (key: “img”), mask with integer index for each target (key: “target_mask”), and additional keys containing stimulus parameters

Return type:

dict[str, Any]

References

Chubb, C., Sperling, G., & Solomon, J. A. (1989).

Texture interactions determine perceived contrast. Proc. Natl. Acad. Sci. USA, 5. https://doi.org/10.1073/pnas.86.23.9631

Domijan, D. (2015).

A Neurocomputational account of the role of contour facilitation in brightness perception. Frontiers in Human Neuroscience, 9(February), 1-16. https://doi.org/10/gh62x2