dimstim is the custom written, open source, cross-platform, visual stimulus software used by the Swindale lab. It’s written in Python and uses Andrew Straw’s Vision Egg visual stimulus library. Vision Egg itself does all drawing to screen via OpenGL.
dimstim has precise frame-by-frame control of what happens on screen, and has been tested on 200 Hz monitors with 5 ms frame times. It allows for permutation and covariation of a wide variety of stimulus parameters, depending on stimulus type. Stimulus types include blank screen, flashed and drifing bars and gratings, manually controlled bars and gratings, artificial and natural scene movies, and sparse noise. Stimulus parameters include spatial location, orientation, speed, duration, size, contrast, brightness, and spatial and temporal frequencies. Spatial parameters are specified in degrees of spatial angle, given the distance to the screen.
Stimulus parameters are communicated on a frame-by-frame basis to an acquisition computer via a Data Translation digital output board, for simultaneous recording of stimulus timing and neuronal responses.
Note that dimstim has only been thoroughly tested in 32-bit Windows XP. It should run in other operating systems, but it may not run with quite the same degree of temporal accuracy.
dimstim is described in the paper Python for large-scale electrophysiology.
Download
dimstim is available in its own GitHub repository.
Example movie
Here is an example natural scene movie which was converted to greyscale for use in dimstim.
Example script
Here is an example dimstim Python script for a drifting grating experiment:
In this example, grating orientation, spatial and temporal frequency are the only 3 parameters
assigned multiple values, and therefore the only ones to vary from one stimulus “sweep” (6 sec
in duration) to the next. Each varies independently because each is set to a different
dimension (second code block from bottom). This script can be modified into a flashed grating
experiment by setting the orientation (ori
) to vary from 0 to 180 degrees instead of 0 to
360, setting the temporal frequency (tfreqCycSec
) to 0, setting the phase (phase0
) to a
range of values in degrees, and decreasing the sweep duration (sweepSec
). The stimulus is
centered on-screen according to the position previously set by a manually controlled oriented
bar ("Manbar0"
) stimulus. Some initialization code and stimulus parameters are omitted for
brevity. Comments are preceded by a #
. More example scripts, one for each stimulus type, can
be found in the examples folder.