FEM_stimulation

class nrv.fmod.FEM_stimulation(model_fname=None, endo_mat='endoneurium_ranck', peri_mat='perineurium', epi_mat='epineurium', ext_mat='saline', comsol=True, Ncore=None)[source]

FEM_based_simulation object are designed to connect all other objects required to compute the external potential voltage for axons using FEM :

  • Shape and positon of the nerve

  • Shape and position of each fascicle

  • the materials for the FEM stimulation : endoneurium, perineurium, epineurium and external material

  • a list of electrode(s)

  • a list of corresponding current stimuli

Parameters:
  • model_fname (str) – name of the comsol mph file to solve

  • endo_mat (str) – specification of the endoneurium material, see material for further details

  • peri_mat (str) – specification of the perineurium material, see material for further details

  • epi_mat (str) – specification of the epineurium material, see material for further details

  • ext_mat (str) – specification of the external material (everything but the nerve), see material for further details

Methods

FEM_stimulation.__init__([model_fname, ...])

Instrantiation an extracellular_context object, empty shell to store electrodes and stimuli

FEM_stimulation.add_electrode(electrode, ...)

Add a stimulation electrode and its stimulus to the stimulation, only it the electrode is FEM based.

FEM_stimulation.change_stimulus_from_electrode(...)

Change the stimulus of the ID_elec electrods

FEM_stimulation.clear_electrodes_footprints()

clear the footprints for all electrodes from existing array

FEM_stimulation.compute_electrodes_footprints(x, ...)

Compute the footprints for all electrodes

FEM_stimulation.compute_vext(time_index)

Compute the external potential on a array of coordinate for a time sample of all synchronised stimuli with all electrodes.

FEM_stimulation.get_parameters()

Generic method returning all the atributes of an NRV_class instance

FEM_stimulation.is_empty()

check if a stimulation object is empty (No electrodes and stimuli, no external field can be computed).

FEM_stimulation.load(data[, C_model])

Load all extracellular context properties from a dictionary or a json file

FEM_stimulation.load_extracel_context([data])

FEM_stimulation.plot(axes[, color])

FEM_stimulation.remove_fascicles([ID])

remove a fascicle of the FEM simulation

FEM_stimulation.reset_electrodes()

FEM_stimulation.reset_stimuli()

FEM_stimulation.reshape_fascicle(Fascicle_D)

Reshape a fascicle of the FEM simulation

FEM_stimulation.reshape_nerve([Nerve_D, ...])

Reshape the nerve of the FEM simulation

FEM_stimulation.reshape_outerBox(Outer_D[, res])

Reshape the size of the FEM simulation outer box

FEM_stimulation.run_model()

Set materials properties, build geometry and mesh if not already done and solve the FEM model all in one.

FEM_stimulation.save([save, fname, blacklist])

Return extracellular context as dictionary and eventually save it as json file

FEM_stimulation.save_extracel_context([...])

FEM_stimulation.set_Ncore(N)

Set the number of cores to use for the FEM

FEM_stimulation.set_electrodes_footprints(...)

set the footprints for all electrodes from existing array

FEM_stimulation.set_parameters(**kawrgs)

Generic method to set any attribute of NRV_class instance

FEM_stimulation.setup_FEM()

Parameter a model with all added electrodes parameters, material parameters, build geometry and mesh

FEM_stimulation.synchronise_stimuli([...])

Synchronise all stimuli before simulation.

FEM_stimulation.translate([x, y, z])

Move extracellular context electrodes by group translation