dipole#

dipole stimulus example

You can find an interactive version of this example here

stimupy.components.lines.dipole(visual_size=None, ppd=None, shape=None, line_length=None, line_width=0, line_gap=None, rotation=0.0, intensity_lines=(0.0, 1.0))#

Draw a two centered parallel lines

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

  • line_length (Number) – length of the line, in degrees visual angle

  • line_width (Number) – width of the line, in degrees visual angle; if line_width=0 (default), line will be one pixel wide

  • line_gap (Number) – distance between line centers, in degrees visual angle

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

  • intensity_lines ((Number, Number)) – intensity value of the line (default: (0, 1)); background intensity is the mean of these two values

Returns:

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

Return type:

dict[str, Any]