pulse2percept.vision.scotoma
Classes
|
A region of the visual field where native vision is lost |
- class pulse2percept.vision.scotoma.Scotoma(mask, name=None)[source]
A region of the visual field where native vision is lost
A scotoma is eye-centered: it is defined in degrees of visual angle relative to the fovea, and it does not move when gaze does. Neither does an implant, which sits on the retina; the two hold their positions relative to each other while the scene moves past them.
A scotoma says only how much vision is lost where. What lost vision looks like – black, gray, blurred, filled in – is a separate question, and one for whoever composes the final image.
Added in version 0.11.0.
- Parameters:
mask (callable) –
mask(x, y)returning the loss at eye-centered visual-field coordinatesx,y(in dva). 0 is intact native vision and 1 is complete loss; anything in between is a partial defect, which is what leaves room for a measured or graded scotoma without another API.name (str, optional) – What to call this scotoma when it is printed.
Examples
A central geographic-atrophy scotoma 10 degrees across:
>>> from pulse2percept.vision import Scotoma >>> from pulse2percept.units import dva >>> scotoma = Scotoma.circle(5 * dva) >>> float(scotoma(0, 0)), float(scotoma(9, 0)) (1.0, 0.0)
- mirror(name=None)[source]
A copy reflected across the vertical meridian
Purely geometric:
mirrored(x, y) == original(-x, y)in eye-centered visual-field coordinates.Added in version 0.11.0.
- Parameters:
name (str, optional) – Name for the mirrored scotoma (default: original name, marked as mirrored)
- Returns:
scotoma – A new scotoma. The original is left unchanged.
- Return type:
Examples
The fellow eye of a bilateral, meridian-symmetric loss:
>>> from pulse2percept.units import dva >>> from pulse2percept.vision import Scotoma >>> left_scotoma = Scotoma.circle(3 * dva, center=(6, 0) * dva) >>> right_scotoma = left_scotoma.mirror() >>> float(right_scotoma(-6, 0)), float(right_scotoma(6, 0)) (1.0, 0.0)
- classmethod ellipse(x_radius, y_radius, center=(0, 0), name=None)[source]
An elliptical scotoma, lost inside and intact outside
- Parameters:
x_radius (float or Quantity) – Semi-axes of the ellipse, in degrees of visual angle.
y_radius (float or Quantity) – Semi-axes of the ellipse, in degrees of visual angle.
center ((x, y), optional) – Where the ellipse sits relative to the fovea, in dva. Defaults to the fovea itself.
name (str, optional) – What to call this scotoma when it is printed.