pulse2percept.stimuli.psychophysics.tumbling_e

pulse2percept.stimuli.psychophysics.tumbling_e(stroke=1, position=(0, 0), orientation=0, fov=10, polarity='dark', shape=(512, 512))[source]

Tumbling E optotype

Rasterize a Tumbling E and place it in a Scene.

The E uses the standard 5x5 construction: bars and gaps are one stroke wide and the full optotype is 5 * stroke across. The glyph is supersampled and area-averaged; stroke must span at least three output pixels.

The cardinal orientations form the conventional Tumbling-E task, although any finite angle is accepted.

Note

The Tumbling E and the Landolt C (landolt_c()) are different optotypes measured with different tasks (bar direction vs. gap direction). Thresholds obtained with one are not numerically interchangeable with the other.

The analytic E is supersampled and area-averaged onto the requested raster, so edge pixels carry the fraction of the glyph they cover. This keeps bar and gap widths from depending on where the pixel grid happens to fall, and matters most at off-cardinal orientations. stroke must still span at least three output pixels.

Added in version 0.11.0.

Parameters:
  • stroke (float or Quantity, optional) – Angular width of a bar, in degrees of visual angle (e.g. 0.5 * dva). The whole E is 5 * stroke across.

  • position ((x, y), optional) – Center of the optotype in visual-field coordinates, in dva. y grows upwards.

  • orientation (float or Quantity, optional) – Direction the bars point, in degrees counterclockwise from the positive x axis (e.g. 90 * deg): 0 right, 90 up, 180 left, 270 down. Any finite angle is accepted.

  • fov (float or (width, height), optional) – How much of the visual field the scene covers, in dva. A scalar is the horizontal extent, and the vertical one follows from shape.

  • polarity ({'dark', 'light'}, optional) – 'dark' draws a black E on white, 'light' a white E on black.

  • shape ((rows, cols), optional) – Size of the rasterized frame, in pixels.

Returns:

scene

Return type:

Scene

Examples

A 0.5-degree stroke pointing up, five degrees to the right of fixation:

>>> from pulse2percept.stimuli import psychophysics
>>> from pulse2percept.units import deg, dva
>>> scene = psychophysics.tumbling_e(stroke=0.5 * dva,
...                                  position=(5, 0) * dva,
...                                  orientation=90 * deg, fov=15 * dva)
>>> scene.fov
(15.0, 15.0)