mondrian#

mondrian stimulus example

You can find an interactive version of this example here

stimupy.stimuli.mondrians.mondrian(visual_size=None, ppd=None, shape=None, positions=None, sizes=None, intensities=None, intensity_background=0.5)#

Draw Mondrian of given size and intensity at given position

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

  • positions (Sequence[tuple, ... ] or None (default)) – position (y, x) of each Mondrian in degrees visual angle

  • sizes (Sequence[tuple, ... ] or None (default)) – size (height, width, depth) of Mondrian parallelograms in degrees visual angle; if only one number is given, squares will be drawn

  • intensities (Sequence[Number, ... ] or None (default)) – intensity values of each Mondrian, if only one number is given all will have the same intensity

  • intensity_background (float) – intensity value of background

Returns:

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

Return type:

dict[str, Any]