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.
- 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:
- 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:
- 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.
- 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:
- 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.
- 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:
- 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.
- 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:
- 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.
- create_thio(ind, node_type)¶
Create a THIO node.
- 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:
- 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.
- create_tigerholm(ind, node_type)¶
Create a TIGERHOLM node.
- 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:
- 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
¶
-
MRG_DISCRETE:
- 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.
- 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:
- 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:
- 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¶
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.
- 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:
- 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.
- 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:
- 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.
- 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:
- 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¶
- coordinates: np.ndarray¶
- create_thio(ind, node_type)¶
Create a THIO node.
- 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:
- 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¶
- coordinates: np.ndarray¶
- create_tigerholm(ind, node_type)¶
Create a TIGERHOLM node.
- 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:
- 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¶