This wiki documents ViNERS (Visceral Nerve Ensemble Recording & Stimulation), a MATLAB-based computational modelling pipeline for simulating neural interface stimulation and recording from peripheral nerve, as published in (Eiber et al 2021a)
In ViNERS, [finite-element modelling of extracellular electrical fields](Models/nerve_anatomy.m) is coupled with [biophysical simulations of individual axons](Models/axon_model.m) to predict axon stimulation [thresholds](Models/axon_thresholds.m), single-fibre action potentials ([SFAPs](Models/axon_sfap.m)), electroneurogram recordings ([ENG](Models/nerve_recording.m)) and electrically-evoked compound action potentials ([ECAPs](Models/ecap_recording.m)).
Please check out the [+mesh](Mesh/Overview), [+models](Models/Overview), [+plots](Plots/Overview), [+tools](Tools/Overview), and [data](Files) documentation for more details.
ViNERS is designed to operate in a [SPARC dataset structure](https://sparc.science/help/3FXikFXC8shPRd8xZqhjVT). Multiple instances of ViNERS running simultaneously in multiple MATLAB instances are supported. ViNERS can be run on PC or Unix, and some support for Octave is included.
ViNERS is organised as a series of MATLAB packages and is accompanied with some source data (axon diameter distributions for rat Vagus and Pelvic nerves, an example set of rat pelvic nerve fascicle profiles, a GMSH template for a planar electrode array, and the necessary neuron .mod files for ion channel mechanisms).
ViNERS uses [GMSH](https://gmsh.info/) to generate finite-element meshes, [EIDORS](http://eidors3d.sourceforge.net/) to simulate electrical fields and sensitivity functions, and [NEURON](https://neuron.yale.edu/neuron/) to simulate individual axons. The setup and installation script [install_ViNERS](Installation) will walk you through downloading these programs and configuring them with ViNERS.
## How-to
Running a simulation in ViNERS can be broken into several steps, as demonstrated in the [example script](Example):
1. Set up the array, nerve, and axon population to be simulated using [models.electrode_array](Models/electrode_array.m),
[mesh.insert_gmsh_fascicles](Mesh/insert_gmsh_fascicles.m), and [models.axon_population](Models/axon_population.m).
2. Generate a mesh and electric fields using [models.nerve_anatomy](Models/nerve_anatomy.m)
3. Generate membrane current templates using [models.membrane_currents](Models/membrane_currents.m)
4. (if needed) compute nerve stimulation responses using [models.nerve_stimulation](Models/nerve_stimulation.m) or [models.axon_thresholds](Models/axon_thresholds.m)
5. (if needed) compute ensemble or single-axon nerve recordings using [models.nerve_recording](Models/nerve_recording.m) or [models.axon_sfap](Models/axon_sfap.m)
6. (if needed) combine axon responses to electrical stimulation into whole-nerve recording using [models.ECAP_recording](Models/ecap_recording.m)
7. Visualise your results using the visualisations in the [+plots](plots-folder) package.
See [Files](files) for more details about the data files generated by each of these steps.
If you have found ViNERS useful, please cite the paper.