pulse2percept.implants.electrodes

Electrode, PointSource, DiskElectrode, SquareElectrode, HexElectrode

Classes

DiskElectrode(x, y, z, r[, name, activated])

Circular disk electrode

Electrode(x, y, z[, name, activated])

Abstract base class for all electrodes.

HexElectrode(x, y, z, a[, name, activated])

Hexagonal electrode

PointSource(x, y, z[, name, activated])

Idealized current point source

SquareElectrode(x, y, z, a[, name, activated])

Square electrode

class pulse2percept.implants.electrodes.Electrode(x, y, z, name=None, activated=True)[source]

Abstract base class for all electrodes.

Parameters:
  • x/y/z (double) – 3D location of the electrode. The coordinate system is centered over the fovea. Positive x values move the electrode into the right visual field. Positive y values move the electrode into the left visual field. Positive z values move the electrode either into the cortex or into the vitreos humor.

  • name (str, optional) – Electrode name

  • activated (bool) – To deactivate, set to False. Deactivated electrodes cannot receive stimuli.

plot(autoscale=False, ax=None)[source]

Plot

Parameters:
  • autoscale (bool, optional) – Whether to adjust the x,y limits of the plot

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – A Matplotlib axes object. If None given, a new one will be created.

Returns:

ax – Returns the axis object of the plot

Return type:

matplotlib.axes.Axes

class pulse2percept.implants.electrodes.PointSource(x, y, z, name=None, activated=True)[source]

Idealized current point source

Parameters:
  • x/y/z (double) – 3D location of the electrode. The coordinate system is centered over the fovea. Positive x values move the electrode into the nasal retina. Positive y values move the electrode into the superior retina. Positive z values move the electrode away from the retina into the vitreous humor (sometimes called electrode-retina distance).

  • name (str, optional) – Electrode name

  • activated (bool) – To deactivate, set to False. Deactivated electrodes cannot receive stimuli.

electric_potential(x, y, z, amp, sigma)[source]

Calculate electric potential at (x, y, z)

Parameters:
  • x/y/z (double) – 3D location at which to evaluate the electric potential

  • amp (double) – amplitude of the constant current pulse

  • sigma (double) – resistivity of the extracellular solution

Returns:

  • pot (double) – The electric potential at (x, y, z)

  • The electric potential \(V(r)\) of a point source is given by

  • .. math:: – V(r) = frac{sigma I}{4 pi r},

  • where \(\sigma\) is the resistivity of the extracellular solution

  • (typically Ames medium, \(\sigma = 110 \Ohm cm\)),

  • \(I\) is the amplitude of the constant current pulse,

  • and \(r\) is the distance from the stimulating electrode to the

  • point at which the voltage is being computed.

plot(autoscale=False, ax=None)[source]

Plot

Parameters:
  • autoscale (bool, optional) – Whether to adjust the x,y limits of the plot

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – A Matplotlib axes object. If None given, a new one will be created.

Returns:

ax – Returns the axis object of the plot

Return type:

matplotlib.axes.Axes

class pulse2percept.implants.electrodes.DiskElectrode(x, y, z, r, name=None, activated=True)[source]

Circular disk electrode

Parameters:
  • x/y/z (double) – 3D location of the electrode. The coordinate system is centered over the fovea. Positive x values move the electrode into the nasal retina. Positive y values move the electrode into the superior retina. Positive z values move the electrode away from the retina into the vitreous humor (sometimes called electrode-retina distance).

  • r (double) – Disk radius in the x,y plane

  • name (str, optional) – Electrode name

  • activated (bool) – To deactivate, set to False. Deactivated electrodes cannot receive stimuli.

electric_potential(x, y, z, v0)[source]

Calculate electric potential at (x, y, z)

Parameters:
  • x/y/z (double) – 3D location at which to evaluate the electric potential

  • v0 (double) – The quasi-static disk potential relative to a ground electrode at infinity

Returns:

pot – The electric potential at (x, y, z).

Return type:

double

The electric potential \(V(r,z)\) of a disk electrode is given by [WileyWebster1982]:

\[V(r,z) = \sin^{-1} \bigg\{ \frac{2a}{\sqrt{(r-a)^2 + z^2} + \sqrt{(r+a)^2 + z^2}} \bigg\} \times \frac{2 V_0}{\pi},\]

for \(z \neq 0\), where \(r\) and \(z\) are the radial and axial distances from the center of the disk, \(V_0\) is the disk potential, \(\sigma\) is the medium conductivity, and \(a\) is the disk radius.

plot(autoscale=False, ax=None)[source]

Plot

Parameters:
  • autoscale (bool, optional) – Whether to adjust the x,y limits of the plot

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – A Matplotlib axes object. If None given, a new one will be created.

Returns:

ax – Returns the axis object of the plot

Return type:

matplotlib.axes.Axes

class pulse2percept.implants.electrodes.SquareElectrode(x, y, z, a, name=None, activated=True)[source]

Square electrode

Added in version 0.7.

Parameters:
  • x/y/z (double) – 3D location of the electrode. The coordinate system is centered over the fovea. Positive x values move the electrode into the nasal retina. Positive y values move the electrode into the superior retina. Positive z values move the electrode away from the retina into the vitreous humor (sometimes called electrode-retina distance).

  • a (double) – Side length of the square

  • name (str, optional) – Electrode name

  • activated (bool) – To deactivate, set to False. Deactivated electrodes cannot receive stimuli.

plot(autoscale=False, ax=None)[source]

Plot

Parameters:
  • autoscale (bool, optional) – Whether to adjust the x,y limits of the plot

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – A Matplotlib axes object. If None given, a new one will be created.

Returns:

ax – Returns the axis object of the plot

Return type:

matplotlib.axes.Axes

class pulse2percept.implants.electrodes.HexElectrode(x, y, z, a, name=None, activated=True)[source]

Hexagonal electrode

Added in version 0.7.

Parameters:
  • x/y/z (double) – 3D location of the electrode. The coordinate system is centered over the fovea. Positive x values move the electrode into the nasal retina. Positive y values move the electrode into the superior retina. Positive z values move the electrode away from the retina into the vitreous humor (sometimes called electrode-retina distance).

  • a (double) – Length of line drawn from the center of the hexagon to the midpoint of one of its sides.

  • name (str, optional) – Electrode name

  • activated (bool) – To deactivate, set to False. Deactivated electrodes cannot receive stimuli.

plot(autoscale=False, ax=None)[source]

Plot

Parameters:
  • autoscale (bool, optional) – Whether to adjust the x,y limits of the plot

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – A Matplotlib axes object. If None given, a new one will be created.

Returns:

ax – Returns the axis object of the plot

Return type:

matplotlib.axes.Axes