pulse2percept.stimuli.Encoder

class pulse2percept.stimuli.Encoder(implant=None)[source]

Base class for encoders.

An encoder converts a desired visual target into stimulation for a prosthetic system. Each subclass defines the target representation it accepts and implements encode().

Only an ImplantEncoder can be installed on Implant.encoder.

Added in version 0.11.0.

Parameters:

implant (Implant, optional) – The implant to encode for. Once bound, an encoder cannot be rebound.

__init__(implant=None)[source]

Methods

__init__([implant])

encode(source)

Encode a visual target as stimulation

Attributes

implant

The implant this encoder is bound to, or None (read-only)

property implant

The implant this encoder is bound to, or None (read-only)

abstractmethod encode(source)[source]

Encode a visual target as stimulation

Parameters:

source – The visual target to encode, in the representation the subclass accepts.

Returns:

stim – The encoded stimulus, in the unit that drives the device.

Return type:

Stimulus