Skip to content

nerve_stimulation.m

Calvin Eiber edited this page Jun 30, 2021 · 1 revision

models.nerve_stimulation computes the stimulus thresholds for each axon in the sample defined in axons~/axons.mat, as generated by models.axon_population, using models.axon_model. models.nerve_stimulation requires an extracellular stimulus field (generated using models.nerve_anatomy), and is structurally similar to models.axon_thresholds.

models.nerve_stimulation differs from models.axon_thresholds in that models.nerve_stimulation simulates predetermined stimulus levels and saves the resulting spike-times for every axon and stimulus level, whereas models.axon_thresholds determines the exact threshold for each axon and saves a handful of examples. The outputs of models.nerve_stimulation are saved to stim~/[name]/type-fascicle0.mat.

in addition to 'name', value syntax, models.nerve_stimulation accepts an options structure; the fields of options.stimulation are treated as additional input arguments (see tools.opts_to_args).

models.nerve_stimulation is part of package +models

Core Syntax:

  • -file 'stimulus*.mat' : specify extracellular potential function (generated using models.nerve_anatomy)
  • -axons 'axons*.mat' : specify axon population for SFAP calculation, defaults to newest axons file in axons~/
  • -out : specify output folder location (default: sfap~/)
  • -stimulus : set stimulus waveform and possibly current levels. See plots.preview_stimulus for more details. if -stim is not set, construct a biphasic stimulus using -pw [pulse-width (ms)] (default: 100 µs, with a 50 µs inter-phase gap). for -fixed-stim the parameter -uA is also relevent as it sets stim levels (default: 10 µA - 1 mA, 25 steps).
  • -pair [ch],-elec [ch],-chan [ch] : set stimulus channel(s) to use. By default the stimulus is a bipolar stimulus, with return = ch + 1. If the stimulus file contains monopolar stimulation fields (see models.nerve_anatomy), monopolar stimuli can be requested using -mono. If numel(ch) > 2 a evenly balanced tripolar (or quadrapolar, or etc) stimulus is generated unless the voltage profile is set explicitly using -pattern [pattern] (where the elements of pattern correspond to the elements of ch. models.analysis_interface.hoc is capable of compositing multiple fields into a single stimulus; if this is desired, you will have to set -stimulus [stim], -mono, and -chan [ch-list] such that size(stim.p,2) == numel(cc).
  • -voltage and -debug are passed to models.axon_model if set.
  • -args {models_axon_model_args} enables arbitrary arguments to be passed through to models.axon_model.

Additional options:

  • -downsample [value] : downsample all axons (scalar value) or set per-axon-class downsample (numel(value) = numel(pop)).
  • -no-parallel : run in debug mode (without using the parallel pool).
  • -fascicles [list] : simulate only the specified fascicles (Default: all)
  • -Ve [Ve_function] : use explicit input voltage fields. If iscell(Ve_function), use the Ve_function corresponding to this fascicle.
  • -axon-t : set 3D axon trajectories (not yet implemented, may interfere with -axons?)
  • -delta-xy [x y] : displace axons by specified amount (in µm)
  • -xy : replace axon positions with a homogenous grid of axons, similar to models.axon_sfap. The grid is based on the median axon for each class; this can be overridden with the additional arguments -ad [myelinated axon diameter], -gr [g-ratio], -cd [unmyelinated axon diameter]. If the argument -xy-eidors is passed, the axon grid ignores the nerve profile in the axons file and instead uses a grid based on the fascicle geometry in the sensitivity file. -xy-grid generates a full 2D grid sample; by defult, a fast 1D sample is generated instead. -xy-resol [n_axons] sets the grid resolution. -xy-inspect generates an illustration.
  • -fix-Gaines, -fix-Sundt, -fix-MRG : re-run just one class (note: if other classes are defined using models.axon_populations, the model name for those classes are what is used here. If multiple -fix options are set, multiple classes are simulated.
  • -resume skip any file which has already been generated.
  • -q,-quiet : suppress most output to console.

Visualisations

plots_axon_thresholds_nerveStim plots.view_thresholds

plots_preview_spike plots.preview_spike

Clone this wiki locally