pyfibers.models package

Library of fiber models included with PyFibers.

class pyfibers.models.MRGFiber(diameter, **kwargs)

Bases: Fiber

Implementation of the MRG fiber model.

create_flut(i)

Create a single FLUT segment for MRG fiber type.

Parameters:

i (int) – index of fiber segment

Return type:

Section

Returns:

nrn.h.Section

create_mysa(i)

Create a single MYSA segment for MRG fiber type.

Parameters:

i (int) – index of fiber segment

Return type:

Section

Returns:

nrn.h.Section

create_node(index, node_type)

Create a node of Ranvier for MRG_DISCRETE fiber type.

Parameters:
  • index (int) – index of fiber segment

  • node_type (str) – type of node (active or passive)

Return type:

Section

Returns:

nrn.h.Section

create_stin(i)

Create a STIN segment for MRG fiber type.

Parameters:

i (int) – index of fiber segment

Return type:

Section

Returns:

nrn.h.Section

generate(**kwargs)

Build fiber model sections with NEURON.

Parameters:

kwargs – passed to superclass generate method

Return type:

Fiber

Returns:

Fiber object

get_mrg_params()

Get geometrical parameters for MRG fiber model and save to self.

Raises:

ValueError – If an invalid fiber diameter is passed in.

Return type:

None

submodels = ['MRG_DISCRETE', 'MRG_INTERPOLATION', 'SMALL_MRG_INTERPOLATION']
class pyfibers.models.RattayFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Rattay fiber model.

create_rattay(ind, node_type)

Create a RATTAY node.

Parameters:
  • ind (int) – Node index in the fiber.

  • node_type (str) – Node type (‘active’ or ‘passive’).

Return type:

Section

Returns:

Created node with Rattay mechanisms.

generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

submodels = ['RATTAY']
class pyfibers.models.SchildFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Schild fiber model.

create_schild(ind, node_type)

Create a SCHILD node.

Parameters:
  • ind (int) – node index in the fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

Section

Returns:

created node with SCHILD mechanisms

generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

submodels = ['SCHILD97', 'SCHILD94']
class pyfibers.models.SundtFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Sundt fiber model.

create_sundt(ind, node_type)

Create a SUNDT node.

Parameters:
  • ind (int) – node index in the fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

Section

Returns:

created node with Sundt mechanisms

generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

submodels = ['SUNDT']
class pyfibers.models.ThioFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Thio fiber model.

balance()

Balance membrane currents.

Return type:

None

create_thio(ind, node_type)

Create a THIO node.

Parameters:
  • ind (int) – node index in the fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

None

Returns:

NEURON section with THIO node mechanisms

generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

submodels = ['THIO_AUTONOMIC', 'THIO_CUTANEOUS']
thio_params = {'THIO_AUTONOMIC': [0.036813, 0.075747, 0.000376, 0.000156, 4e-06, 0.009546, 0.002864, 0.002789, 0.005337, 0.000289, 2.4e-05, 6e-06, 0.00021, 0.056316, 23.117539], 'THIO_CUTANEOUS': [0.035663, 0.115643, 0.000504, 0.002016, 0.000188, 0.000361, 3e-06, 0.000106, 0.327196, 0.001786, 4.4e-05, 0.000755, 0.009242, 0.000456, 27.513088]}
class pyfibers.models.TigerholmFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Tigerholm Fiber model.

balance()

Balance membrane currents.

Return type:

None

create_tigerholm(ind, node_type)

Create a TIGERHOLM node.

Parameters:
  • ind (int) – node index in fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

Section

Returns:

NEURON section with TIGERHOLM mechanism

generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

submodels = ['TIGERHOLM']

Submodules

pyfibers.models.mrg module

Implementation of the MRG fiber model.

Based on the following papers: Original implementation: https://doi.org/10.1152/jn.00353.2001 Extension to 2 um diameter: https://doi.org/10.1152/jn.00989.2003 Extension to 1 um diameter: https://doi.org/10.1088/1741-2552/aa6a5f Implementation of interpolation model: https://doi.org/10.1371/journal.pcbi.1009285 Implementation of small interpolation model: https://doi.org/10.1371/journal.pcbi.1011833

class pyfibers.models.mrg.FiberParameters

Bases: TypedDict

MRG_DISCRETE: MRGDiscreteParameters
MRG_INTERPOLATION: MRGInterpolationParameters
SMALL_MRG_INTERPOLATION: MRGInterpolationParameters
class pyfibers.models.mrg.MRGDiscreteParameters

Bases: TypedDict

axon_diam: list[float]
delta_z: list[int]
diameters: list[float]
mycm: list[float]
mygm: list[float]
nl: list[int]
node_diam: list[float]
node_length: list[float]
paranodal_length_1: list[float]
paranodal_length_2: list[int]
rhoa: list[float]
class pyfibers.models.mrg.MRGFiber(diameter, **kwargs)

Bases: Fiber

Implementation of the MRG fiber model.

apc: list
coordinates: np.ndarray
create_flut(i)

Create a single FLUT segment for MRG fiber type.

Parameters:

i (int) – index of fiber segment

Return type:

Section

Returns:

nrn.h.Section

create_mysa(i)

Create a single MYSA segment for MRG fiber type.

Parameters:

i (int) – index of fiber segment

Return type:

Section

Returns:

nrn.h.Section

create_node(index, node_type)

Create a node of Ranvier for MRG_DISCRETE fiber type.

Parameters:
  • index (int) – index of fiber segment

  • node_type (str) – type of node (active or passive)

Return type:

Section

Returns:

nrn.h.Section

create_stin(i)

Create a STIN segment for MRG fiber type.

Parameters:

i (int) – index of fiber segment

Return type:

Section

Returns:

nrn.h.Section

delta_z: float
gating: dict[str, h.Vector]
gating_variables: dict[str, str]
generate(**kwargs)

Build fiber model sections with NEURON.

Parameters:

kwargs – passed to superclass generate method

Return type:

Fiber

Returns:

Fiber object

get_mrg_params()

Get geometrical parameters for MRG fiber model and save to self.

Raises:

ValueError – If an invalid fiber diameter is passed in.

Return type:

None

im: list
length: float
longitudinal_coordinates: np.ndarray
mrg_params: dict
myelinated: bool
nc: h.NetCon
nodecount: int
nodes: list
path: nd_line
potentials: np.ndarray
sections: list
stim: h.NetStim
submodels = ['MRG_DISCRETE', 'MRG_INTERPOLATION', 'SMALL_MRG_INTERPOLATION']
syn: h.ExpSyn
time: h.Vector
vext: list
vm: list
class pyfibers.models.mrg.MRGInterpolationParameters

Bases: TypedDict

axon_diam: Callable[[float], float]
delta_z: Callable[[float], float]
mycm: Callable[[float], float]
mygm: Callable[[float], float]
nl: Callable[[float], float]
node_diam: Callable[[float], float]
node_length: Callable[[float], float]
paranodal_length_1: Callable[[float], float]
paranodal_length_2: Callable[[float], float]
rhoa: Callable[[float], float]

pyfibers.models.rattay module

Implementation of Rattay fiber model.

As described in Rattay 1993: https://doi.org/10.1109/10.250575

class pyfibers.models.rattay.RattayFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Rattay fiber model.

apc: list
coordinates: np.ndarray
create_rattay(ind, node_type)

Create a RATTAY node.

Parameters:
  • ind (int) – Node index in the fiber.

  • node_type (str) – Node type (‘active’ or ‘passive’).

Return type:

Section

Returns:

Created node with Rattay mechanisms.

delta_z: float
gating: dict[str, h.Vector]
gating_variables: dict[str, str]
generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

im: list
length: float
longitudinal_coordinates: np.ndarray
myelinated: bool
nc: h.NetCon
nodecount: int
nodes: list
path: nd_line
potentials: np.ndarray
sections: list
stim: h.NetStim
submodels = ['RATTAY']
syn: h.ExpSyn
time: h.Vector
vext: list
vm: list

pyfibers.models.schild module

Implementation of Schild 1994 and 1997 fiber models.

As described in: 1994 implementation: http://dx.doi.org/10.1152/jn.1994.71.6.2338 1997 implementation: http://dx.doi.org/10.1152/jn.1997.78.6.3198 Updated by: http://dx.doi.org/10.1152/jn.00315.2020

class pyfibers.models.schild.SchildFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Schild fiber model.

apc: list
coordinates: np.ndarray
create_schild(ind, node_type)

Create a SCHILD node.

Parameters:
  • ind (int) – node index in the fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

Section

Returns:

created node with SCHILD mechanisms

delta_z: float
gating: dict[str, h.Vector]
gating_variables: dict[str, str]
generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

im: list
length: float
longitudinal_coordinates: np.ndarray
myelinated: bool
nc: h.NetCon
nodecount: int
nodes: list
path: nd_line
potentials: np.ndarray
sections: list
stim: h.NetStim
submodels = ['SCHILD97', 'SCHILD94']
syn: h.ExpSyn
time: h.Vector
vext: list
vm: list

pyfibers.models.sundt module

Implementation of Sundt Fiber model.

As described in Sundt 2015: https://doi.org/10.1152/jn.00226.2015

class pyfibers.models.sundt.SundtFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Sundt fiber model.

apc: list
coordinates: np.ndarray
create_sundt(ind, node_type)

Create a SUNDT node.

Parameters:
  • ind (int) – node index in the fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

Section

Returns:

created node with Sundt mechanisms

delta_z: float
gating: dict[str, h.Vector]
gating_variables: dict[str, str]
generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

im: list
length: float
longitudinal_coordinates: np.ndarray
myelinated: bool
nc: h.NetCon
nodecount: int
nodes: list
path: nd_line
potentials: np.ndarray
sections: list
stim: h.NetStim
submodels = ['SUNDT']
syn: h.ExpSyn
time: h.Vector
vext: list
vm: list

pyfibers.models.thio module

The copyrights of this software are owned by Duke University.

class pyfibers.models.thio.ThioFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Thio fiber model.

apc: list
balance()

Balance membrane currents.

Return type:

None

coordinates: np.ndarray
create_thio(ind, node_type)

Create a THIO node.

Parameters:
  • ind (int) – node index in the fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

None

Returns:

NEURON section with THIO node mechanisms

delta_z: float
gating: dict[str, h.Vector]
gating_variables: dict[str, str]
generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

im: list
length: float
longitudinal_coordinates: np.ndarray
myelinated: bool
nc: h.NetCon
nodecount: int
nodes: list
passive_end_nodes: bool
path: nd_line
potentials: np.ndarray
sections: list
stim: h.NetStim
submodels = ['THIO_AUTONOMIC', 'THIO_CUTANEOUS']
syn: h.ExpSyn
thio_params = {'THIO_AUTONOMIC': [0.036813, 0.075747, 0.000376, 0.000156, 4e-06, 0.009546, 0.002864, 0.002789, 0.005337, 0.000289, 2.4e-05, 6e-06, 0.00021, 0.056316, 23.117539], 'THIO_CUTANEOUS': [0.035663, 0.115643, 0.000504, 0.002016, 0.000188, 0.000361, 3e-06, 0.000106, 0.327196, 0.001786, 4.4e-05, 0.000755, 0.009242, 0.000456, 27.513088]}
time: h.Vector
vext: list
vm: list

pyfibers.models.tigerholm module

Implementation of Tigerholm fiber model.

As described in Tigerholm 2014: https://doi.org/10.1152/jn.00777.2012

class pyfibers.models.tigerholm.TigerholmFiber(diameter, delta_z=8.333, **kwargs)

Bases: Fiber

Tigerholm Fiber model.

apc: list
balance()

Balance membrane currents.

Return type:

None

coordinates: np.ndarray
create_tigerholm(ind, node_type)

Create a TIGERHOLM node.

Parameters:
  • ind (int) – node index in fiber

  • node_type (str) – node type (‘active’ or ‘passive’)

Return type:

Section

Returns:

NEURON section with TIGERHOLM mechanism

delta_z: float
gating: dict[str, h.Vector]
gating_variables: dict[str, str]
generate(**kwargs)

Build the fiber model sections in NEURON according to a specified generation strategy.

This method either uses the desired number of nodes (n_nodes), the number of sections (n_sections), or determines the total number of sections from the fiber length and the spacing Fiber.delta_z.

Parameters:
  • function_list – List of callable functions that each create a section. Typically structured as [node_func, myelin_func].

  • n_nodes – Number of nodes of Ranvier.

  • n_sections – Total number of sections in the fiber.

  • length – Total length of the fiber (µm). Overrides n_sections if given.

  • enforce_odd_nodecount – If True, ensures that the fiber has an odd number of nodes.

Return type:

Fiber

Returns:

The updated Fiber instance after generation.

Raises:

AssertionError – If the computed number of sections does not align with the function_list-based pattern.

im: list
length: float
longitudinal_coordinates: np.ndarray
myelinated: bool
nc: h.NetCon
nodecount: int
nodes: list
passive_end_nodes: bool
path: nd_line
potentials: np.ndarray
sections: list
stim: h.NetStim
submodels = ['TIGERHOLM']
syn: h.ExpSyn
time: h.Vector
vext: list
vm: list