grating_induction#

grating_induction stimulus example

You can find an interactive version of this example here

stimupy.stimuli.gratings.grating_induction(visual_size=None, ppd=None, shape=None, frequency=None, n_bars=None, bar_width=None, period='ignore', rotation=0.0, phase_shift=0, intensities=(0.0, 1.0), target_width=None, intensity_target=0.5, origin='corner')#

Grating induction illusion using a sinewave grating

Parameters:
  • visual_size (Sequence[Number, Number], Number, or None (default)) – visual size [height, width] of image, in degrees

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

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

  • frequency (Number, or None (default)) – spatial frequency of grating, in cycles per degree visual angle

  • n_bars (int, or None (default)) – number of bars in the grating

  • bar_width (Number, or None (default)) – width of a single bar, in degrees visual angle

  • period ("even", "odd", "either" or "ignore" (default)) – ensure whether the grating has “even” number of phases, “odd” number of phases, either or whether not to round the number of phases (“ignore”)

  • rotation (float, optional) – rotation (in degrees), counterclockwise, by default 0.0 (horizontal)

  • phase_shift (float) – phase shift of grating in degrees

  • intensity_bars (Sequence[float, ...]) – intensity value for each bar, by default (1.0, 0.0). Can specify as many intensities as n_bars; If fewer intensities are passed than n_bars, cycles through intensities

  • target_width (float) – width of target stripe in degrees visual angle

  • intensities (Sequence[float, float] or None (default)) – min and max intensity of sinewave

  • origin ("corner", "mean" or "center") – if “corner”: set origin to upper left corner (default) if “mean”: set origin to hypothetical image center if “center”: set origin to real center (closest existing value to mean)

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

McCourt, M. E. (1982).

A spatial frequency dependent grating-induction effect. Vision Research, 22, 119-134. https://doi.org/10.1016/0042-6989(82)90173-0