rectangular#

rectangular stimulus example

You can find an interactive version of this example here

stimupy.stimuli.bullseyes.rectangular(visual_size=None, ppd=None, shape=None, frequency=None, n_frames=None, frame_width=None, rotation=0.0, phase_shift=0, intensity_frames=(0.0, 1.0), intensity_background=0.5, intensity_target=0.5, origin='mean', clip=True)#

Square “bullseye”, i.e., set of rings with target in center

Essentially frames(target_indices=1)

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_frames (int, or None (default)) – number of frames in the grating

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

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

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

  • intensity_frames (Sequence[float, float]) – min and max intensity of square-wave, by default (0.0, 1.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. Can specify as many intensities as number of target_indices; If fewer intensities are passed than target_indices, cycles through intensities

  • 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)

  • clip (Bool) – if True, clip stimulus to image size (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

Bindman, D., & Chubb, C. (2004).

Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. https://doi.org/10.1016/S0042-6989(03)00430-9