Skip to main content
Advertisement

< Back to Article

Table 1.

Comparison between PyFibers and other published open-source tools that include computational modeling of nerve fiber responses to electrical stimulation.

More »

Table 1 Expand

Fig 1.

Example sequence of operations in PyFibers to create a model fiber and simulate its response to extracellular stimulation.

More »

Fig 1 Expand

Fig 2.

Simulation results generated by the code in Box 2; code for recording state variables, calculating the single fiber action potential, and generating plots is not included in Box 2, but can be found in the dataset associated with this manuscript. Stimulation of a 10 μm diameter MRG fiber with a length of 25 nodes (27 mm). The extracellular potentials were calculated using a point source of current located halfway along the fiber at an electrode-fiber distance of 250 μm in an isotropic, homogeneous medium with a conductivity of 10 S/m. The stimulation was a 0.15 ms, monophasic rectangular pulse (from t = 0.1 to 0.25 ms) delivered at threshold amplitude (−0.766 mA). A) Transmembrane potential plotted for all fiber nodes. Vm = −80 mV (white) is the resting transmembrane potential. B) Transmembrane potential recorded at node 11 (“center”) and node 23 (“end”, i.e., second-to-last since the end nodes are passive). C) Gating variables for the center node. D) Single fiber action potential recorded from a point electrode at 90% of the fiber length with a 250 μm electrode-fiber distance in an isotropic medium with conductivity of 10 S/m. Vm = transmembrane voltage (mV).

More »

Fig 2 Expand

Table 2.

Myelinated and unmyelinated fiber models available in PyFibers.

More »

Table 2 Expand

Fig 3.

Construction of a model fiber in PyFibers.

A) For homogeneous fibers (e.g., unmyelinated fibers), the fiber model includes a single set of mechanisms and ultrastructure that is repeated for the instructed number of sections. B) Fibers with multiple types of sections (e.g., MRG as shown) have a repeating series of sections with heterogeneous membrane mechanisms and ultrastructure, defined in the model as a sequence from one node until just before the next node. This sequence is repeated to one less than the instructed number of nodes, and a node is added to the end of the fiber for symmetry. Example shown: MRG model fiber with 4 nodes and 11 sections per node, resulting in a final section count of nsections = (nnodes − 1)*11 + 1 = (4 − 1) * 11 + 1 = 34. Figure is not to scale.

More »

Fig 3 Expand

Fig 4.

Three example threshold searches superimposed on the same axes—one with both initial bounds too low, one with both too high, and one with initial bounds straddling the threshold.

For the cases with the initial bounds both too low or too high, a bounds search (white triangles) is first conducted to identify bounds that straddle the threshold, and then the bisection search (black triangles) is initiated. In the case where the initial bounds straddle the threshold, a bisection search begins immediately. The bisection search continues until the difference between the upper and lower bounds is less than the specified search tolerance, and threshold is then considered as the upper bound amplitude.

More »

Fig 4 Expand

Fig 5.

Process of calculating the spatiotemporal profile of extracellular potentials applied to the model fiber by ScaledStim.run_sim(), which incorporates the spatial distribution of potentials in response to 1 mA stimulation (Ve(z)), the unit waveform (W(t)), and the stimulation amplitude (a).

If potentials from multiple sources and the corresponding waveforms are provided, steps A-D are performed for each combination of source/waveform/stimulation amplitude, and the results are summed across sources before proceeding. A) Path for non-branching fiber with an arbitrary trajectory in 3D space, with potentials (given by the colored dots) in space generated for a unit stimulus. B) Electrical potential at each section of the fiber. C) Unitless stimulation waveform, by convention defined with a maximum magnitude of 1. D) Matrix multiplication of spatial distribution of potentials (dim: nsections x 1) and waveform (sampled at every timestep to an array of: 1 x ntimesteps) to obtain Ve(z,t) for a unit stimulus (e.g., 1 mA). E) Ve(z,t) scaled by (signed) amplitude “a”. In this example, a = −1.5, so the final stimulus amplitude of the first phase of the symmetric biphasic pulse is −1.5 mA. F) Ve(z,t) applied to a cable model of a myelinated fiber.

More »

Fig 5 Expand

Fig 6.

Simulations of conduction block using the code in Box 3. AP = action potential; Vm = transmembrane potential. The stimulation and recording setup are shown in panel A; note that the diagram is not to scale and does not show all 25 nodes. A 10 μm MRG fiber with intrinsic activity produced by intracellular stimulation initiated at the node closest to 10% fiber length (from the left), a 20 kHz extracellular square wave (B) delivered via a point source at 50% fiber length at an electrode-fiber distance of 250 μm, and transmembrane potential recorded at the node closest to 90% fiber length. The extracellular signal was delivered from t = 50 to 100 ms (C) at 2.5 and 3 mA and the transmembrane potential at 90% fiber length was recorded (D); only the larger amplitude signal blocked action potential conduction. The search for block threshold in Box 3 yielded −2.81 mA.

More »

Fig 6 Expand

Fig 7.

Effects of modifying fiber ultrastructure on activation thresholds of an MRG fiber, using the code in Box 4. A) Diagram of ultrastructure parameters modified during the analysis. Note that we did not include an analysis of varying number of myelin lamellae, which is also modified by the fiber diameter (D). B) Effects on activation thresholds normalized by the threshold for an unaltered 10 μm MRG fiber. Parameters not described as changed were held constant. For D, all parameters were varied according to the relationships defined by the MRG-interpolation model. For daxon_node, the diameter of the nodes of Ranvier was varied. For INL, the internodal length (i.e., section lengths) was varied. For Dall, all axonal and myelin diameters were varied.

More »

Fig 7 Expand

Fig 8.

Modeling of rat vagus nerve stimulation and recording of single fiber action potentials and compound nerve action potentials using the Peña model in ASCENT with PyFibers.

A) Geometrical model instrumented with stimulation (two contacts) and recording (three contacts) cuffs. The cross sectional x-y view does not show the surrounding tissue. The perineurium is modeled using a contact impedance [47] and therefore is not visible as a distinct geometry. B) Single fiber action potentials from select fiber diameters. All fibers were along the nerve centroid. C) Compound action potential resulting from activation of all 14 fibers, calculated as summation of their single fiber action potentials.

More »

Fig 8 Expand

Fig 9.

Replication of published responses for the MRG fiber model.

Data in black were provided by the original authors [17], and data in purple and green are from the MRG-discrete and MRG-interpolation PyFibers implementations, respectively. All fibers were 21 nodes long and except for panel A, all data are for 10 μm diameter fibers. We used an anodic rectangular pulse for intracellular stimulation (panels A-C) and a monopolar rectangular pulse delivered by a cathodic point current source in an anisotropic medium (sigma(x,y,z) = {1/12, 1/12, 1/3} [S/m], where z is along the axis of the fiber (panels D-E). The stimulation pulse began at t = 0 and lasted for 0.1 ms, except for panel C where we evaluated pairs of pulses (1 ms duration each) and panel D where we evaluated different pulse widths. A) Conduction velocity across fiber diameters, calculated using action potential times from fiber(0.25) to fiber(0.75) after intracellular stimulation at fiber[1]. B) Action potential time course, recorded at the center node (fiber(0.5)) after an intracellular stimulus at fiber[1]. C) Recovery cycle for intracellular stimulation delivered at the center node (fiber(0.5)). We first determined activation threshold (Ith) for a single pulse with 1 ms duration. We then simulated a pair of pulses: one at t1 = 1 ms and Ith, and a second at t2 = 1 ms + interpulse interval; we determined the activation threshold for the second pulse and its difference relative to Ith. D) Strength-duration response for electrode-fiber distances from 100 to 500 μm and longitudinal alignment at (1) the center node, (2) shifted by ¼ of the internodal length, (3) shifted by ½ of the internodal length. For the MRG-discrete implementation, we matched the point current source position to the original publication; the z-position was assigned relative to the start of the fiber. The MRG-interpolation implementation has slightly different ultrastructure, including positions of the nodes of Ranvier; therefore, we altered the longitudinal coordinates of the point current sources to maintain the same position with respect to the center node of Ranvier. E) Current-distance response for point sources with electrode-fiber distances from 109 to 953 μm and longitudinal alignment from −563 to +549 μm (with respect to the center node).

More »

Fig 9 Expand

Fig 10.

Replication of published responses for five of the seven unmyelinated fiber models in PyFibers.

Data from [10] were downloaded from the publicly available repository [49]. All fibers were 5 mm long with 600 sections (i.e., each section was 8.33 μm long and comprised a single segment), and except for panel A, all data are for 1 μm diameter fibers. As in [10], we removed all nonlinear mechanisms from the end nodes, except in the Tigerholm model. Stimulation was an intracellular anodic rectangular pulse beginning at t = 1 ms with a pulse width of 0.1 ms, except for panel C where we evaluated different pulse widths and panel D where we evaluated pairs of pulses (0.1 ms duration each). A) Conduction velocity calculated using action potential times from fiber(0.25) to fiber(0.75) after intracellular stimulation at fiber[1]. Each dot represents one fiber diameter (0.5, 0.75, 1, 1.25, 1.5). B) Action potential time course recorded at the center node fiber(0.5) after an intracellular stimulus at fiber[1]. C) Strength-duration curves calculated using intracellular stimulation at fiber(0.5). D) Recovery cycle for intracellular stimulation delivered at the center node (fiber(0.5)). We first determined activation threshold (Ith) for a single pulse with 0.1 ms duration. We then simulated a pair of 0.1 ms duration pulses: one at t1 = 1 ms and 1.5 * Ith, and a second 0.1 at t2 = 1 ms + inter-stimulus interval (ISI); we determined the activation threshold for the second pulse and its difference relative to Ith. E) Action potential duration calculated by taking the earliest and latest times where Vm > baseline Vm + 0.1*(peak Vm – baseline Vm).

More »

Fig 10 Expand

Fig 11.

ASCENT threshold results for the original HOC NEURON versus novel PyFibers implementations.

Adaptation of the ASCENT tutorial task: stimulation of a monofascicular rat cervical vagus nerve with 13 fiber locations, instrumented with a cuff with two circumneural contacts that delivered a biphasic charge-balanced pulse, with a first phase of 100 μs, interphase delay of 100 μs, and second phase of 400 μs. A) Percent differences in thresholds (left) and absolute activation thresholds (right) for each fiber diameter. Percent difference was calculated as the absolute value of the difference between the HOC and PyFibers thresholds, divided by their mean. B) Threshold search runtimes all executed with the same hardware and compute resources. The bars show the mean runtime across all threshold searches. Dots show the percent improvement of PyFibers over the HOC-based NEURON implementation in ASCENT calculated as 100 * (1 – PyFibers runtime/ HOC runtime).

More »

Fig 11 Expand