pulse2percept.models.axon_map¶
This module implements several equations from [Beyeler2019].
Classes
AxonMapModel(**kwargs) |
Axon map model |
-
class
pulse2percept.models.axon_map.AxonMapModel(**kwargs)[source]¶ Axon map model
Implements the axon map model described in [Beyeler2019], where percepts are elongated along nerve fiber bundle trajectories of the retina.
Parameters: - axlambda (double) – Exponential decay constant along the axon (microns).
- rho (double) – Exponential decay constant away from the axon (microns).
-
build(**build_params)[source]¶ Build the model
Every model must have a
`buildmethod, which is meant to perform all expensive one-time calculations. You must callbuildbefore callingpredict_percept.You can override
buildin your own model (for a good example, see the AxonMapModel). You will want to make sure that:- all
build_paramstake effect, - the flag
_is_builtis set, - the method returns
self.
One way to do this is to call the BaseModel’s
buildmethod from within your own model:class MyModel(BaseModel):
- def build(self, **build_params):
- super(MyModel, self).build(self, **build_params) # Add your own code here…
Parameters: **build_params (Additional build parameters) – Additional build parameters passed as keyword arguments (e.g., model.build(engine='joblib')). Note that these must be listed inget_params; i.e., you can’t add any new parameters outside the constructor.- all
-
calc_bundle_tangent(xc, yc)[source]¶ Calculates orientation of fiber bundle tangent at (xc,yc)
Parameters: yc (xc,) – (x,y) location of point at which to calculate bundle orientation in microns.
-
find_closest_axon(bundles, xret=None, yret=None)[source]¶ Finds the closest axon segment for every point (
xret,yret)
-
get_tissue_coords(xdva, ydva)[source]¶ Converts dva to retinal coords
Parameters: ydva (xdva,) – x,y coordinates in dva Returns: xret, yret (double or array-like) – Corresponding x,y coordinates in microns
-
predict_percept(implant, t=None)[source]¶ Predict a percept
Parameters: - implant (
ProsthesisSystem) – Stimulus can be passed viastim. - fps (int, double) – Frames per second at which the percept should be rendered.
- n_frames (int) – If None, will simulate for the duration of the stimulus plus one frame (rounding up).
- implant (