square#

square stimulus example

You can find an interactive version of this example here

stimupy.stimuli.sbcs.square(target_radius, visual_size=None, ppd=None, shape=None, surround_radius=None, rotation=0.0, intensity_surround=0.0, intensity_background=0.5, intensity_target=0.5, origin='mean')#

Simultaneous contrast stimulus with square target and surround field

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

  • target_radius (float) – radius of target, in degrees visual angle

  • surround_radius (float) – radius of surround context field, in degrees visual angle

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

  • intensity_surrond (float, optional) – intensity of surround context field, by default 0.0

  • intensity_background (float, optional) – intensity value of background, by default 0.5

  • intensity_target (float, or Sequence[float, ...], optional) – intensity value for each target, by default 0.5.

  • origin ("corner", "mean" or "center") – if “corner”: set origin to upper left corner if “mean”: set origin to hypothetical image center (default) 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 frame (key: “target_mask”), and additional keys containing stimulus parameters

Return type:

dict[str, Any]