pulse2percept.implants.retina.prima

PhotovoltaicPixel, PRIMAPivotal, Lorach2015Array, Ho2019FlatArray, Huang2021Array

Classes

Ho2019FlatArray(pixel_size[, z, eye, ...])

Create a flat photovoltaic array of [Ho2019]

Huang2021Array(pixel_size[, z, eye, ...])

Create a vertical-junction photovoltaic array of [Huang2021]

Lorach2015Array([z, eye, preprocess, ...])

Create the 70 um photovoltaic array of [Lorach2015]

PRIMA(**kwargs)

Deprecated name for the pivotal-trial PRIMA array.

PRIMA40(**kwargs)

Deprecated name for the F40 array of [Ho2019].

PRIMA55(**kwargs)

Deprecated name for the F55 array of [Ho2019].

PRIMA75(**kwargs)

Deprecated name for the 70 um array of [Lorach2015].

PRIMAPivotal([z, eye, preprocess, ...])

Create the PRIMA array used in the pivotal PRIMAvera trial

PhotovoltaicPixel(x, y, z, radius, apothem)

Photovoltaic pixel

class pulse2percept.implants.retina.prima.PhotovoltaicPixel(x, y, z, radius, apothem, name=None, activated=True, orientation='vertical', rot=0)[source]

Photovoltaic pixel

A hexagonal pixel body with a circular active electrode at its center.

Added in version 0.7.

Parameters:
  • x/y/z (double) – Location of the pixel (um) in the array’s own coordinate frame.

  • radius (double) – Radius (um) of the active electrode.

  • apothem (double) – Apothem (um) of the hexagonal pixel body.

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

  • orientation ({'horizontal', 'vertical'}, optional) –

    Pixel orientation.

    Added in version 0.11.0.

  • rot (double, optional) –

    Local pixel rotation (deg, positive counter-clockwise).

    Added in version 0.11.0.

Notes

  • Lengths may be given as plain numbers of microns or as unitful quantities. See pulse2percept.units.

coordinate_unit = um[source]

The unit electrode coordinates are stored in. Electrodes hold plain numbers, which is what every kernel downstream of them expects; this says what those numbers mean.

coordinates(unit=None)[source]

3D position of the electrode

Added in version 0.10.0.

Parameters:

unit (Unit, optional) – Length unit to express the position in. If None, the position is returned as it is stored (microns).

Returns:

coords – An ordinary NumPy array [x, y, z], never a Quantity.

Return type:

(3,) np.ndarray

Examples

>>> from pulse2percept.implants import DiskElectrode
>>> from pulse2percept.units import mm
>>> DiskElectrode(1000, 0, 100, 200).coordinates(mm)
array([1. , 0. , 0.1])
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

property width

Flat-to-flat width (um) of the hexagon

Added in version 0.11.0.

class pulse2percept.implants.retina.prima.PRIMAPivotal(z=0, eye='right', preprocess=False, safe_mode=False, encoder=<object object>)[source]

Create the PRIMA array used in the pivotal PRIMAvera trial

The implant has 378 photovoltaic pixels, each 100 um wide on a 100 um hexagonal grid, with a 28 um active electrode, on a 2 x 2 mm substrate [Holz2026]. The same configuration was used in the earlier first-in-human study [Palanker2020].

Added in version 0.7.

Changed in version 0.11.0: Pixel width corrected from 85 to 100 um; pixel centers are unchanged.

Changed in version 0.11.0: Renamed from PRIMA to distinguish this pivotal-trial configuration from future commercial hardware.

Parameters:
  • z (float, list, or Quantity, optional) – Electrode height (um) above the array’s own plane: a scalar applies to every electrode, a list of 378 entries gives each its own. May be given as unitful quantities (e.g. z=100 * um); see pulse2percept.units.

  • eye ({'right', 'left'}, optional) – Eye in which array is implanted.

  • preprocess (bool or callable, optional) – Either True/False to indicate whether to execute the implant’s default preprocessing method whenever a stimulus is prepared, or a custom function (callable).

  • safe_mode (bool, optional) –

    Enforces the documented projector operating envelope: 880 nm illumination, irradiance <= 3.5 mW/mm^2, ON durations on the 0.7 ms grid and <= 9.8 ms, duty cycle <= 0.294, and frame rate <= 30 Hz. All 378 pixels may be illuminated simultaneously. This is not a biological safety limit or a demonstrated hardware maximum.

    Changed in version 0.11.0: Checks the optical envelope instead of electrical charge balance.

  • encoder (ImplantEncoder, optional) –

    Image/video encoder. Defaults to PRIMAEncoder, which describes the pivotal-trial projector. Pass None to disable automatic encoding.

    Added in version 0.11.0.

Notes

  • The active-electrode diameter was estimated from Fig. 1 of [Palanker2020].

  • prepare_stim() returns optical irradiance (mW/mm^2). Photovoltaic conversion is not modeled.

  • Gray levels map linearly onto the projector’s 0.7 ms duration grid. The clinical camera-to-pulse-duration transfer function is not published, so that mapping is a pulse2percept convention.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

family = 'PRIMA'

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property electrode_array

Electrode array

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 2 x 2 mm substrate.

Added in version 0.11.0.

property row_spacing

Distance (um) between adjacent pixel rows.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.Lorach2015Array(z=0, eye='right', preprocess=False, safe_mode=False, encoder=<object object>)[source]

Create the 70 um photovoltaic array of [Lorach2015]

The array has 142 pixels, each 70 um wide on a 75 um hexagonal grid, with a 20 um active electrode, on a nominal 1 mm substrate.

Added in version 0.7.

Changed in version 0.11.0: Renamed from PRIMA75; that name was pulse2percept shorthand.

Parameters:
  • z (float, list, or Quantity, optional) – Electrode height (um) above the array’s own plane: a scalar applies to every electrode, a list of 142 entries gives each its own. May be given as unitful quantities (e.g. z=100 * um); see pulse2percept.units.

  • eye ({'right', 'left'}, optional) – Eye in which array is implanted.

  • preprocess (bool or callable, optional) – Either True/False to indicate whether to execute the implant’s default preprocessing method whenever a stimulus is prepared, or a custom function (callable).

  • safe_mode (bool, optional) –

    Not supported: no optical operating envelope has been published for this array, and the PRIMA projector limits are specific to PRIMAPivotal. True raises when a stimulus is checked.

    Changed in version 0.11.0: No longer applies the PRIMA projector envelope to this array.

  • encoder (ImplantEncoder, optional) –

    Image/video encoder. Defaults to a PhotovoltaicEncoder configured for the illumination reported in [Lorach2015] (915 nm, 4 mW/mm^2, 4 ms pulses at 40 Hz). Pass None to disable automatic encoding.

    Added in version 0.11.0.

Notes

  • Driven by pulsed near-infrared illumination: prepare_stim() returns irradiance (mW/mm^2). Photovoltaic conversion to tissue current is not modeled.

  • The default encoder reproduces the 915 nm, 4 mW/mm^2, 4 ms, 40 Hz illumination of the [Lorach2015] grating experiments. Gray levels set ON duration linearly, which is a pulse2percept simulation convention: the paper does not specify a natural-image grayscale transfer function.

  • [Lorach2015] reports the 65 um row spacing as the “pixel pitch”.

  • Seven rim pixels extend beyond the nominal 1 mm substrate and are clipped when plotted.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property electrode_array

Electrode array

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 1 mm substrate.

Added in version 0.11.0.

property row_spacing

Distance (um) between adjacent pixel rows.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

family = None

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.Ho2019FlatArray(pixel_size, z=0, eye='right', preprocess=False, safe_mode=False, encoder=<object object>)[source]

Create a flat photovoltaic array of [Ho2019]

Supports the F55 and F40 arrays on a 1 mm substrate:

pixel_size (um)

pixels

row spacing

active electrode

55 (F55)

250

47.6 um

14 um diameter

40 (F40)

502

34.6 um

10 um diameter

Added in version 0.11.0.

Parameters:
  • pixel_size ({55, 40}) – Pixel width (um), which selects the device variant.

  • z (float, list, or Quantity, optional) – Electrode height (um) above the array’s own plane: a scalar applies to every electrode, a list of them gives each its own. May be given as unitful quantities (e.g. z=100 * um); see pulse2percept.units.

  • eye ({'right', 'left'}, optional) – Eye in which array is implanted.

  • preprocess (bool or callable, optional) – Either True/False to indicate whether to execute the implant’s default preprocessing method whenever a stimulus is prepared, or a custom function (callable).

  • safe_mode (bool, optional) – Not supported: no optical operating envelope has been published for this array, and the PRIMA projector limits are specific to PRIMAPivotal.

  • encoder (ImplantEncoder, optional) – Image/video encoder. Pass None to disable automatic encoding.

Notes

  • Driven by pulsed near-infrared illumination: prepare_stim() returns irradiance (mW/mm^2). Photovoltaic conversion to tissue current is not modeled.

  • The default encoder reproduces the 915 nm, 8 mW/mm^2, 4 ms, 40 Hz illumination of the [Ho2019] grating experiments. Gray levels set ON duration linearly, which is a pulse2percept simulation convention: the paper does not specify a natural-image grayscale transfer function.

  • [Ho2019] also describes pillar arrays Pil55 and Pil40, which are not modeled here.

  • The F55 layout is reconstructed from Fig. 2(a). The F40 outline is not published; its 502 pixels are taken as the nearest lattice sites to the substrate center.

  • The 1 um isolation trenches are covered by the shared return electrode, so gap is 0.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property electrode_array

Electrode array

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 1 mm substrate.

Added in version 0.11.0.

property row_spacing

Distance (um) between adjacent pixel rows.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

family = None

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.Huang2021Array(pixel_size, z=0, eye='right', preprocess=False, safe_mode=False, encoder=<object object>)[source]

Create a vertical-junction photovoltaic array of [Huang2021]

Supports four arrays on a 1.5 mm substrate. Only exposed pixels are modeled as electrodes:

pixel_size (um)

n_electrodes

fabricated pixels

active electrode

55

421

526

22 um diameter

40

821

1027

16 um diameter

30

1388

1735

12 um diameter

20

2806

3508

8 um diameter

Added in version 0.11.0.

Parameters:
  • pixel_size ({55, 40, 30, 20}) – Pixel width (um), which selects the device variant.

  • z (float, list, or Quantity, optional) – Electrode height (um) above the array’s own plane: a scalar applies to every electrode, a list of them gives each its own. May be given as unitful quantities (e.g. z=100 * um); see pulse2percept.units.

  • eye ({'right', 'left'}, optional) – Eye in which array is implanted.

  • preprocess (bool or callable, optional) – Either True/False to indicate whether to execute the implant’s default preprocessing method whenever a stimulus is prepared, or a custom function (callable).

  • safe_mode (bool, optional) –

    Not supported: no optical operating envelope has been published for this array, and the PRIMA projector limits are specific to PRIMAPivotal. True raises when a stimulus is checked.

    Changed in version 0.11.0: No longer applies the PRIMA projector envelope to this array.

  • encoder (ImplantEncoder, optional) –

    Image/video encoder. Defaults to a PhotovoltaicEncoder configured for the illumination reported in [Huang2021] (880 nm, 4.7 mW/mm^2, 10 ms pulses at 2 Hz). Pass None to disable automatic encoding.

    Added in version 0.11.0.

Notes

  • Driven by pulsed near-infrared illumination: prepare_stim() returns irradiance (mW/mm^2). Photovoltaic conversion to tissue current is not modeled.

  • The default encoder reproduces the 880 nm, 10 ms, 2 Hz full-field stimulation of [Huang2021]. Gray levels set ON duration linearly (a p2p convention).

  • n_total_pixels gives the fabricated pixel count; peripheral pixels covered by the common return are not modeled as electrodes.

  • Exposed-pixel layouts are reconstructed from Fig. 7 of [Huang2021]. Three rim pixels of the 20 um array are inferred; one is ambiguous.

  • Isolation trenches are covered by the shared return electrode, so gap is 0.

  • The substrate is modeled as a 1.5 mm circle; the small die notch is omitted.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property electrode_array

Electrode array

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 1.5 mm substrate.

Added in version 0.11.0.

property row_spacing

Distance (um) between adjacent pixel rows.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

family = None

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.PRIMA55(**kwargs)[source]

Deprecated name for the F55 array of [Ho2019].

Deprecated since version 0.11.0: Use Ho2019FlatArray(55) instead.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_array

Electrode array

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
family = None

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 1 mm substrate.

Added in version 0.11.0.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property row_spacing

Distance (um) between adjacent pixel rows.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.PRIMA40(**kwargs)[source]

Deprecated name for the F40 array of [Ho2019].

Deprecated since version 0.11.0: Use Ho2019FlatArray(40) instead.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_array

Electrode array

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
family = None

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 1 mm substrate.

Added in version 0.11.0.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property row_spacing

Distance (um) between adjacent pixel rows.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.PRIMA(**kwargs)[source]

Deprecated name for the pivotal-trial PRIMA array.

Deprecated since version 0.11.0: Use PRIMAPivotal instead.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_array

Electrode array

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
family = 'PRIMA'

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 2 x 2 mm substrate.

Added in version 0.11.0.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property row_spacing

Distance (um) between adjacent pixel rows.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.

class pulse2percept.implants.retina.prima.PRIMA75(**kwargs)[source]

Deprecated name for the 70 um array of [Lorach2015].

Deprecated since version 0.11.0: Use Lorach2015Array instead.

check_stim(stim)[source]

Require finite, non-negative irradiance.

Charge balance does not apply to light and is not checked. With safe_mode, a subclass may additionally check its own documented optical operating envelope; arrays without one reject safe_mode rather than borrow another device’s limits.

Added in version 0.11.0.

property electrode_array

Electrode array

property electrode_names

Return a list of all electrode names in the electrode array

property electrode_objects

Return a list of all electrode objects in the array

property electrodes

Return all electrode names and objects in the electrode array

Internally, electrodes are stored in an ordered dictionary. You can iterate over different electrodes in the array as follows:

for name, electrode in implant.electrodes.items():
    print(name, electrode)

You can access an individual electrode by indexing directly into the implant, e.g. implant['A1'] or implant[0], and ask how many there are with len(implant).

property encoder

Stimulus encoder used for image or video input.

Must be an ImplantEncoder. Model-aware encoders such as TraceEncoder are called directly instead. If None, dimensionless image/video stimuli are not encoded automatically.

Assigning an unbound encoder (encoder.implant is None) binds it to this implant. An encoder bound to a different implant is rejected with a ValueError.

property eye

Implanted eye

A RetinalImplant can be implanted either in a left eye (‘left’) or right eye (‘right’). Models such as AxonMapModel will treat left and right eyes differently (for example, adjusting the location of the optic disc).

Examples

Implant Argus II in a left eye:

>>> from pulse2percept.implants.retina import ArgusII
>>> implant = ArgusII(eye='left')
family = None

Named device family, if applicable, e.g. 'PRIMA'. .. versionadded:: 0.11.0

property max_current

Total instantaneous current (uA) the stimulator can source

property n_electrodes

Number of electrodes in the array

This is equivalent to calling electrode_array.n_electrodes.

placement = 'subretinal'

Where the device sits relative to the tissue it stimulates, where the literature is unambiguous about it; None where it is not, or where the class describes a family rather than a device.

plot(annotate=False, autoscale=True, ax=None, stim=None, stim_cmap=False)[source]

Plot the implant and its 1 mm substrate.

Added in version 0.11.0.

prepare_stim(source)[source]

Turn a source into stimulation the implant can deliver.

Preparation applies preprocessing, converts the source to a Stimulus, encodes dimensionless visual input when an encoder is present, reshapes it to the electrode array, removes deactivated electrodes, applies threshold calibration, and runs safety checks. The input is not modified and the result is not stored.

Prepared stimuli use the implant’s stimulus_unit (electrical current for most devices; irradiance for PRIMA).

Images and videos require an encoder unless preprocessing already converts them to the implant’s stimulus_unit.

Added in version 0.11.0: Replaces the stateful stim property.

Parameters:

source (Stimulus source type) – Any source accepted by Stimulus, including electrical stimulation and image or video input for the implant encoder.

Returns:

stim – Stimulation delivered by the implant, or None for an empty source.

Return type:

Stimulus or None

Examples

>>> from pulse2percept.implants import DiskElectrode, Implant
>>> from pulse2percept.stimuli import BiphasicPulse
>>> implant = Implant(DiskElectrode(0, 0, 0, 100))
>>> stim = implant.prepare_stim(BiphasicPulse(30, 0.45))

Stimulate Electrode B7 in Argus II with 13 uA:

>>> from pulse2percept.implants.retina import ArgusII
>>> stim = ArgusII().prepare_stim({'B7': 13})

Argus II includes an encoder, so it can prepare an image directly:

>>> from pulse2percept.stimuli import samples
>>> ArgusII().prepare_stim(samples.logo_bvl()).unit
uA
preprocess_stim(stim)[source]

Preprocess the stimulus

This method is executed every time a stimulus is prepared.

No preprocessing is performed by default, but the user can define their own method in implants that inherit from return stim Implant.

A custom method must return a Stimulus object with the correct number of electrodes for the implant.

Parameters:

stim (Stimulus source type) – A valid source type for the Stimulus object (e.g., scalar, NumPy array, pulse train).

Returns:

stim_out

Return type:

Stimulus object

property raster

Raster pattern used to schedule stimulation across electrodes.

Assigning a raster binds it to this implant.

property row_spacing

Distance (um) between adjacent pixel rows.

property scene_input_frame

Coordinate frame used to register scene input.

'eye' means gaze changes which scene content reaches the implant; 'head' means scene input is fixed relative to the head.

Defaults to default_scene_input_frame. Setting to None restores that default.

Added in version 0.11.0.

stimulus_unit = mW/mm^2[source]

The device is illuminated, not driven by a current source.

technology = 'photovoltaic'

Stimulation technology, e.g. 'photovoltaic'. .. versionadded:: 0.11.0

property thresholds

Perceptual threshold current (uA) for each electrode.

Assign a single current for the whole array, a per-electrode dict, or None to clear the calibration. Threshold-relative pulse trains are calibrated against whatever is in force at the moment prepare_stim() runs.

Added in version 0.10.0.

Changed in version 0.11.0: Changing thresholds affects the next stimulus prepared, rather than rewriting one the implant was holding.