implants

Functions for creating retinal implants

ArgusI([x_center, y_center, h, rot, …])

Methods

ArgusII([x_center, y_center, h, rot])

Methods

Electrode(etype, radius, x_center, y_center)

Attributes

ElectrodeArray(etype, radii, xs, ys[, hs, names])

Methods

ArgusI

class pulse2percept.implants.ArgusI(x_center=0, y_center=0, h=0, rot=0.0, use_legacy_names=False)[source]

Bases: pulse2percept.implants.ElectrodeArray

Methods

add_electrode(electrode) Adds an electrode to an ElectrodeArray object
add_electrodes(radii, xs, ys[, hs, names]) Adds electrodes to an ElectrodeArray object
get_index(name) Returns the index of an electrode called name
__init__(x_center=0, y_center=0, h=0, rot=0.0, use_legacy_names=False)[source]

Create an ArgusI array on the retina

This function creates an ArgusI array and places it on the retina such that the center of the array is located at [x_center, y_center] (microns) and the array is rotated by rotation angle rot (radians).

The array is oriented in the visual field as shown in Fig. 1 of Horsager et al. (2009); that is, if placed in (0,0), the top two rows will lie in the lower retina (upper visual field):

  y       A1 B1 C1 D1                     260 520 260 520
  ^       A2 B2 C2 D2   where electrode   520 260 520 260
  |       A3 B3 C3 D3   diameters are:    260 520 260 520
  -->x    A4 B4 C4 D4                     520 260 520 260

Electrode order is: A1, B1, C1, D1, A2, B2, …, D4. If use_legacy_names is True, electrode order is: L6, L2, M8, M4, … An electrode can be addressed by index (integer) or name.

Parameters:

x_center : float

x coordinate of the array center (um)

y_center : float

y coordinate of the array center (um)

h : float || array_like

Distance of the array to the retinal surface (um). Either a list with 16 entries or a scalar.

rot : float

Rotation angle of the array (rad). Positive values denote counter-clock-wise rotations.

Examples

Create an ArgusI array centered on the fovea, at 100um distance from the retina:

>>> from pulse2percept import implants
>>> argus = implants.ArgusI(x_center=0, y_center=0, h=100, rot=0)

Get access to electrode ‘B1’:

>>> my_electrode = argus['B1']

ArgusII

class pulse2percept.implants.ArgusII(x_center=0, y_center=0, h=0, rot=0.0)[source]

Bases: pulse2percept.implants.ElectrodeArray

Methods

add_electrode(electrode) Adds an electrode to an ElectrodeArray object
add_electrodes(radii, xs, ys[, hs, names]) Adds electrodes to an ElectrodeArray object
get_index(name) Returns the index of an electrode called name
__init__(x_center=0, y_center=0, h=0, rot=0.0)[source]

Create an ArgusII array on the retina

This function creates an ArgusII array and places it on the retina such that the center of the array is located at [x_center, y_center] (microns) and the array is rotated by rotation angle rot (radians).

The array is oriented upright in the visual field, such that an array with center (0,0) has the top three rows lie in the lower retina (upper visual field), as shown below:

          A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
  y       B1 B2 B3 B4 B5 B6 B7 B8 B9 B10
  ^       C1 C2 C3 C4 C5 C6 C7 C8 C9 C10
  |       D1 D2 D3 D4 D5 D6 D7 D8 D9 D10
  -->x    E1 E2 E3 E4 E5 E6 E7 E8 E9 E10
          F1 F2 F3 F4 F5 F6 F7 F8 F9 F10

Electrode order is: A1, A2, …, A10, B1, B2, …, F10. An electrode can be addressed by index (integer) or name.

Parameters:

x_center : float

x coordinate of the array center (um)

y_center : float

y coordinate of the array center (um)

h : float || array_like

Distance of the array to the retinal surface (um). Either a list with 60 entries or a scalar.

rot : float

Rotation angle of the array (rad). Positive values denote counter-clock-wise rotations.

Examples

Create an ArgusII array centered on the fovea, at 100um distance from the retina:

>>> from pulse2percept import implants
>>> argus = implants.ArgusII(x_center=0, y_center=0, h=100, rot=0)

Get access to electrode ‘E7’:

>>> my_electrode = argus['E7']

Electrode

class pulse2percept.implants.Electrode(etype, radius, x_center, y_center, height=0, name=None)[source]

Bases: object

Attributes

height Returns the electrode-retina distance

Methods

current_spread(xg, yg, layer[, alpha, n]) The current spread due to a current pulse through an electrode, reflecting the fall-off of the current as a function of distance from the electrode center.
get_height() Returns the electrode-retina distance
receptive_field(xg, yg[, rftype, size]) An electrode’s receptive field
set_height(height) Sets the electrode-to-retina distance
__init__(etype, radius, x_center, y_center, height=0, name=None)[source]

Create an electrode on the retina

This function creates a disk electrode of type etype and places it on the retina at location (xs, ys) in microns. The electrode has radius radius (microns) and sits a distance height away from the retinal surface. The coordinate system is anchored around the fovea at (0, 0).

Parameters:

etype : str

Electrode type, {‘epiretinal’, ‘subretinal’}

radius : float

The radius of the electrode (in microns).

x_center : float

The x coordinate of the electrode center (in microns) from the fovea.

y_center : float

The y location of the electrode (in microns) from the fovea

height : float

The height of the electrode from the retinal surface:

  • epiretinal array: distance to the ganglion layer
  • subretinal array: distance to the bipolar layer

name : string

Electrode name

current_spread(xg, yg, layer, alpha=14000, n=1.69)[source]

The current spread due to a current pulse through an electrode, reflecting the fall-off of the current as a function of distance from the electrode center. This can be calculated for any layer in the retina. Based on equation 2 in Nanduri et al [1].

Parameters:

xg : array

x-coordinates of the retinal grid

yg : array

y-coordinates of the retinal grid

layer: str

Layer for which to calculate the current spread:

  • ‘OFL’: optic fiber layer, ganglion axons
  • ‘INL’: inner nuclear layer, containing the bipolars

alpha : float

A constant to do with the spatial fall-off.

n : float

A constant to do with the spatial fall-off (Default: 1.69, based on Ahuja et al. [2] An In Vitro Model of a Retinal Prosthesis. Ashish K. Ahuja, Matthew R. Behrend, Masako Kuroda, Mark S. Humayun, and James D. Weiland (2008). IEEE Trans Biomed Eng 55.

get_height()[source]

Returns the electrode-retina distance

For epiretinal electrodes, this returns the distance to the ganglion cell layer. For subretinal electrodes, this returns the distance to the bipolar layer.

height

Returns the electrode-retina distance

For epiretinal electrodes, this returns the distance to the ganglion cell layer. For subretinal electrodes, this returns the distance to the bipolar layer.

receptive_field(xg, yg, rftype=’square’, size=None)[source]

An electrode’s receptive field

Parameters:

xg : array_like

Array of all x coordinates

yg : array_like

Array of all y coordinates

rftype : {‘square’, ‘gaussian’}

The type of receptive field. - ‘square’: A simple square box receptive field with side length

size.

  • ‘gaussian’: A Gaussian receptive field where the weight drops off

    as a function of distance from the electrode center. The standard deviation of the Gaussian is size.

size : float, optional

Parameter describing the size of the receptive field. For square receptive fields, this corresponds to the side length of the square. For Gaussian receptive fields, this corresponds to the standard deviation of the Gaussian. Default: Twice the electrode radius.

set_height(height)[source]

Sets the electrode-to-retina distance

This function sets the electrode-to-retina distance according to height. For an epiretinal device, we calculate the distance to the ganglion cell layer (layer thickness depends on retinal location). For a subretinal device, we calculate the distance to the bipolar layer (layer thickness again depends on retinal location).

Estimates of layer thickness based on: LoDuca et al. Am J. Ophthalmology 2011 Thickness Mapping of Retinal Layers by Spectral Domain Optical Coherence Tomography Note that this is for normal retinal, so may overestimate thickness. Thickness from their paper (averaged across quadrants):

0-600 um radius (from fovea):

  • Layer 1. (Nerve fiber layer) = 4
  • Layer 2. (Ganglion cell bodies + inner plexiform) = 56
  • Layer 3. (Bipolar bodies, inner nuclear layer) = 23

600-1550 um radius:

  • Layer 1. 34
  • Layer 2. 87
  • Layer 3. 37.5
1550-3000 um radius:
  • Layer 1. 45.5
  • Layer 2. 58.2
  • Layer 3. 30.75

We place our ganglion axon surface on the inner side of the nerve fiber layer. We place our bipolar surface 1/2 way through the inner nuclear layer. So for an epiretinal array the bipolar layer is L1 + L2 + 0.5 * L3.

ElectrodeArray

class pulse2percept.implants.ElectrodeArray(etype, radii, xs, ys, hs=0, names=None)[source]

Bases: object

Methods

add_electrode(electrode) Adds an electrode to an ElectrodeArray object
add_electrodes(radii, xs, ys[, hs, names]) Adds electrodes to an ElectrodeArray object
get_index(name) Returns the index of an electrode called name
__init__(etype, radii, xs, ys, hs=0, names=None)[source]

Create an ElectrodeArray on the retina

This function creates an electrode array of type etype and places it on the retina. Lists should specify, for each electrode, its size (radii), location on the retina (xs and ys), distance to the retina (height, hs), and a string identifier (names, optional).

Array location should be given in microns, where the fovea is located at (0, 0).

Single electrodes in the array can be addressed by index (integer) or name.

Parameters:

radii : array_like

List of electrode radii.

xs : array_like

List of x-coordinates for the center of the electrodes (microns).

ys : array_like

List of y-coordinates for the center of the electrodes (microns).

hs : float | array_like, optional, default: 0

List of electrode heights (distance from the retinal surface).

names : array_like, optional, default: None

List of names (string identifiers) for each eletrode.

Examples

A single epiretinal electrode called ‘A1’, with radius 100um, sitting at retinal location (0, 0), 10um away from the retina:

>>> from pulse2percept import implants
>>> implant0 = implants.ElectrodeArray('epiretinal', 100, 0, 0, hs=10,
...                                    names='A1')

Get access to the electrode with name ‘A1’ in the first array:

>>> my_electrode = implant0['A1']

An array with two electrodes of size 100um, one sitting at (-100, -100), the other sitting at (0, 0), with 0 distance from the retina, of type ‘subretinal’:

>>> implant1 = implants.ElectrodeArray('subretinal', [100, 100],
...                                    [-100, 0], [-100, 0], hs=[0, 0])
add_electrode(electrode)[source]

Adds an electrode to an ElectrodeArray object

This function adds a single electrode to an existing ElectrodeArray object. The electrode must have the same type as the array (see implants.SUPPORTED_IMPLANT_TYPES).

Parameters:

electrode : implants.Electrode

An electrode object specifying type, size, and location of the electrode on the retina.

add_electrodes(radii, xs, ys, hs=0, names=None)[source]

Adds electrodes to an ElectrodeArray object

This function adds one or more electrodes to an existing ElectrodeArray object. Lists should specify, for each electrode to be added, the size (radii), location on the retina (xs and ys), distance to the retina (height, hs), and a string identifier (names, optional).

Array location should be given in microns, where the fovea is located at (0, 0).

Single electrodes in the array can be addressed by index (integer) or name.

Parameters:

radii : array_like

List of electrode radii.

xs : array_like

List of x-coordinates for the center of the electrodes (microns).

ys : array_like

List of y-coordinates for the center of the electrodes (microns).

hs : float | array_like, optional, default: 0

List of electrode heights (distance from the retinal surface).

names : array_like, optional, default: None

List of names (string identifiers) for each eletrode.

Examples

Adding a single electrode of radius 50um sitting at (0, 0) to an existing ElectrodeArray object:

>>> implant = ElectrodeArray('epiretinal', 100, 100, 100)
>>> implant.add_electrodes(50, 0, 0)
get_index(name)[source]

Returns the index of an electrode called name

This function searches the electrode array for an electrode with string identifier name. If found, the index of that electrode is returned, else None.

Parameters:

name : str

An electrode name (string identifier).

Returns:

A valid electrode index or None.