stimupy.stimuli.pinwheels#

Demos#

Functions#

pinwheel

Pinwheel / radial White stimulus

pinwheel(visual_size=None, ppd=None, shape=None, frequency=None, n_segments=None, segment_width=None, rotation=0.0, target_indices=(), target_width=None, target_center=None, intensity_segments=(0.0, 1.0), intensity_background=0.5, intensity_target=0.5, origin='mean')[source]#

Pinwheel / radial White stimulus

Parameters:
  • visual_size ((float, float)) – The shape of the stimulus in degrees of visual angle. (y,x)

  • ppd (int) – pixels per degree (visual angle)

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

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

  • n_segments (int, or None (default)) – number of segments

  • segment_width (Number, or None (default)) – angular width of a single segment, in degrees

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

  • target_indices (int, or Sequence[int, ...]) – indices segments where targets will be placed

  • target_width (float, or Sequence[float, ...], optional) – target width (outer - inner radius) in deg visual angle, by default 1.0 Can specify as many target_widths as target_indices; if fewer widths are passed than indices, cycles through intensities

  • target_center (float, or Sequence[float, ...], optional) – center (radius) in deg visual angle where each target will be placed within its segment, by default 1.0. Can specify as many centers as target_indices; if fewer centers are passed than indices, cycles through intensities

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

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

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

Robinson, A. E., Hammon, P. S., & de Sa, V. R. (2007).

Explaining brightness illusions using spatial filtering and local response normalization. Vision Research, 47(12), 1631-1644. https://doi.org/10.1016/j.visres.2007.02.017