nerve

class nrv.nmod.nerve(length=10000, diameter=100, Outer_D=5, ID=0, **kwargs)[source]
A nerve in NRV is defined as:
  • a list of fascicle

  • an analytical stimulation or a FEM_stimulation context

A nerve can be instrumented by adding couples of electrodes+stimulus

The extracellular context of the nerve is automatically generated from the context of its fascicles and an optional context added directly to the nerve.

Customizable Attributes:

Attributes

Type

Default

Description

ID

int

0

Identification number of the nerve.

L

float

None

Length of the nerve.

D

float

None

Diameter of the nerve.

y_grav_center

float

0

y-position of the nerve center.

z_grav_center

float

0

z-position of the nerve center.

postproc_label

str

None

Label of the axon postprocessing funtion, used for the buildin postproc functions.

postproc_function

function

None

Axon postprocessing funtion, used for the custom postproc functions.

postproc_script

str | function

None

Either postprocessing funtion or postprocessing funtion label, automatically set depending on the type

postproc_kwargs

dict

None

key arguments of the postporcessing function

save_results

bool

False

If True, nerve configuration and all axon simulations results are saved in save_path directory.

save_path

str

“”

Path of the directory where simulation results should be saved.

return_parameters_only

bool

False

If True (and save_results also True), only the parameters should be returned from the simulation.

loaded_footprints

bool

False

If False, the footprints already computed are favored over new footprint computation.

verbose

bool

False

Plot or not.

Note

Customizable attributes can either be set using nerve.set_parameters() or simply by reafecting the value of the attribute.

Tip

Additional simulation parameters can be changed using (nerve.set_axons_parameters(), nerve.change_stimulus_from_electrode(), …).

Parameters:
  • length (float) – Nerve length, in um

  • diameter (float) – Nerve diameter, in um

  • Outer_D (float) – Outer saline box diameter, in mm

  • ID (int) – Nerve unique identifier

Attributes

nerve.has_FEM_extracel

nerve.n_ax

Number of axons in the nerves

nerve.n_fasc

Number of fascicles in the nerves

Methods

nerve.__init__([length, diameter, Outer_D, ID])

Instanciates an empty nerve.

nerve.add_fascicle(fascicle[, ID, y, z, ...])

Add a fascicle to the list of fascicles

nerve.attach_extracellular_recorder(rec)

attach an extracellular recorder to the axon

nerve.attach_extracellular_stimulation(...)

attach a extracellular context of simulation for an axon.

nerve.change_stimulus_from_electrode(...)

Change the stimulus of the ID_elec electrods

nerve.clear_I_clamp()

Clear any I-clamp attached to the nerve

nerve.clear_context([extracel_context, ...])

Clear all stimulation and recording mecanism

nerve.compute_electrodes_footprints(**kwargs)

compute electrodes footprints

nerve.define_circular_contour(D[, y_c, z_c])

Define a circular countour to the nerve

nerve.define_ellipsoid_contour(a, b[, y_c, ...])

Define ellipsoidal contour

nerve.define_length(L)

Set the length over the x axis of the nerve

nerve.extracel_status()

Check if an extracellular context is attached to the instance

nerve.fit_circular_contour([y_c, z_c, ...])

Define a circular countour to the nerve

nerve.get_axons_parameters([...])

get parameters of axons in the nerve

nerve.get_circular_contour()

Returns the properties of the nerve contour considered as a circle (y and z center and diameter)

nerve.get_fascicles([ID_only])

Return a _fascicle.fascicle object from it ID in the nerve

nerve.get_n_ax([id_fasc])

Returns the number of axons in a given fascicle or in all the nerve

nerve.get_parameters()

Generic method returning all the atributes of an NRV_class instance

nerve.import_contour(smthing_else)

Define contour from a file

nerve.insert_I_Clamp(position, t_start, ...)

Insert a IC clamp stimulation

nerve.intracel_status()

Check if an intracellular context is attached to the instance

nerve.load(data[, extracel_context, ...])

Load a fascicle configuration from a json file

nerve.plot(axes[, contour_color, ...])

plot the nerve in the Y-Z plane (transverse section)

nerve.rec_status()

Check if a recording context is attached to the instance

nerve.save([fname, extracel_context, ...])

Save a fascicle in a json file

nerve.set_ID(ID)

set the ID of the nerve

nerve.set_axons_parameters([...])

set parameters of axons in the nerve

nerve.set_parameters(**kawrgs)

Generic method to set any attribute of NRV_class instance

nerve.shut_recorder_down()

Shuts down the recorder locally

nerve.simulate(**kwargs)

Simulate the nerve with the proposed extracellular context.