visigoth.stimuli.RandomDotMotion

class visigoth.stimuli.RandomDotMotion(win, shape='square', size=0.05, color=1, density=16.7, speed=5, interval=3, pos=(0, 0), aperture=5, elliptical=True)[source]

Random dot motion stimulus (from Newsome, Movshon, and others).

To use this stimulus, you must alternate calls between update, which repositions the dots with a given direction and coherence, and draw which shows the stimulus on the window. You must call update on every screen refresh to get the expected motion characteristics.

__init__(win, shape='square', size=0.05, color=1, density=16.7, speed=5, interval=3, pos=(0, 0), aperture=5, elliptical=True)[source]

Initialize the stimulus.

Parameters
winPsychopy Window

Window object with additional attributes added by visigoth.

shape“square” | “circle”

Shape of each dot.

sizefloat

Size of each dot, in degrees.

colorPsychopy color

Color of the dots, in [-1, 1] luminance or RGB.

densityfloat

Dot density in dots per degrees per second.

speedfloat

Speed of coherent motion, in degrees per second.

intervalint

Coherently moving dots will be redrawn in a new position every interval frames.

pospair of floats

The x, y coordinates of the center of the dot field, in degrees.

aperturefloat or pair of floats

Size of the aperture. A single value can be given for a square / circular aperture. In the latter case, size is diameter.

ellipticalbool

If true, aperture is elliptical (or circular). Dots can move coherently through the corners, but will not be shown.

Methods

__init__(win[, shape, size, color, density, …])

Initialize the stimulus.

draw()

Draw the Psychopy object to the window.

reset()

Generate random starting positions for each set of dots.

update(direction, coherence)

Advance the dot animation one frame.