neurom.core._neuron¶
Neuron classes and functions.
Functions
Returns a neuron starting at section. |
|
Iterator to a neurite, neuron or neuron population. |
|
Iterator to the sections in a neurite, neuron or neuron population. |
|
Return an iterator to the segments in a collection of neurites. |
|
Make a soma object from a MorphIO soma. |
Classes
Column labels for internal data representation. |
|
Class representing a neurite tree. |
|
Neurite iteration orders. |
|
Type of neurite. |
|
Class representing a simple neuron. |
|
Simple recursive tree class. |
-
class
neurom.core._neuron.
COLS
[source]¶ Bases:
object
Column labels for internal data representation.
-
class
neurom.core._neuron.
Neurite
(root_node)[source]¶ Bases:
object
Class representing a neurite tree.
-
iter_sections
(order=<function Section.ipreorder>, neurite_order=<NeuriteIter.FileOrder: 1>)[source]¶ Iteration over section nodes.
- Parameters
order – section iteration order within a given neurite. Must be one of: Section.ipreorder: Depth-first pre-order iteration of tree nodes Section.ipreorder: Depth-first post-order iteration of tree nodes Section.iupstream: Iterate from a tree node to the root nodes Section.ibifurcation_point: Iterator to bifurcation points Section.ileaf: Iterator to all leaves of a tree
neurite_order – order upon which neurites should be iterated. Values: - NeuriteIter.FileOrder: order of appearance in the file - NeuriteIter.NRN: NRN simulator order: soma -> axon -> basal -> apical
-
-
class
neurom.core._neuron.
NeuriteIter
(value)[source]¶ Bases:
neurom.utils.OrderedEnum
Neurite iteration orders.
-
class
neurom.core._neuron.
Neuron
(filename, name=None)[source]¶ Bases:
morphio._morphio.mut.Morphology
Class representing a simple neuron.
-
class
neurom.core._neuron.
Section
(morphio_section)[source]¶ Bases:
object
Simple recursive tree class.
-
append_section
(section)[source]¶ Appends a section to the current section object.
- Parameters
section (morphio.Section|morphio.mut.Section|Section|morphio.PointLevel) – a section
-
ibifurcation_point
(iter_mode=<function Section.ipreorder>)[source]¶ Iterator to bifurcation points.
- Parameters
iter_mode – iteration mode. Default: ipreorder.
-
-
neurom.core._neuron.
iter_neurites
(obj, mapfun=None, filt=None, neurite_order=<NeuriteIter.FileOrder: 1>)[source]¶ Iterator to a neurite, neuron or neuron population.
Applies optional neurite filter and mapping functions.
- Parameters
obj – a neurite, neuron or neuron population.
mapfun – optional neurite mapping function.
filt – optional neurite filter function.
neurite_order (NeuriteIter) – order upon which neurites should be iterated - NeuriteIter.FileOrder: order of appearance in the file - NeuriteIter.NRN: NRN simulator order: soma -> axon -> basal -> apical
Examples
Get the number of points in each neurite in a neuron population
>>> from neurom.core import iter_neurites >>> n_points = [n for n in iter_neurites(pop, lambda x : len(x.points))]
Get the number of points in each axon in a neuron population
>>> import neurom as nm >>> from neurom.core import iter_neurites >>> filter = lambda n : n.type == nm.AXON >>> mapping = lambda n : len(n.points) >>> n_points = [n for n in iter_neurites(pop, mapping, filter)]
-
neurom.core._neuron.
iter_sections
(neurites, iterator_type=<function Section.ipreorder>, neurite_filter=None, neurite_order=<NeuriteIter.FileOrder: 1>)[source]¶ Iterator to the sections in a neurite, neuron or neuron population.
- Parameters
neurites – neuron, population, neurite, or iterable containing neurite objects
iterator_type – section iteration order within a given neurite. Must be one of: Section.ipreorder: Depth-first pre-order iteration of tree nodes Section.ipostorder: Depth-first post-order iteration of tree nodes Section.iupstream: Iterate from a tree node to the root nodes Section.ibifurcation_point: Iterator to bifurcation points Section.ileaf: Iterator to all leaves of a tree
neurite_filter – optional top level filter on properties of neurite neurite objects.
neurite_order (NeuriteIter) – order upon which neurites should be iterated - NeuriteIter.FileOrder: order of appearance in the file - NeuriteIter.NRN: NRN simulator order: soma -> axon -> basal -> apical
Examples
Get the number of points in each section of all the axons in a neuron population
>>> import neurom as nm >>> from neurom.core import ites_sections >>> filter = lambda n : n.type == nm.AXON >>> n_points = [len(s.points) for s in iter_sections(pop, neurite_filter=filter)]
-
neurom.core._neuron.
iter_segments
(obj, neurite_filter=None, neurite_order=<NeuriteIter.FileOrder: 1>)[source]¶ Return an iterator to the segments in a collection of neurites.
- Parameters
obj – neuron, population, neurite, section, or iterable containing neurite objects
neurite_filter – optional top level filter on properties of neurite neurite objects
neurite_order – order upon which neurite should be iterated. Values: - NeuriteIter.FileOrder: order of appearance in the file - NeuriteIter.NRN: NRN simulator order: soma -> axon -> basal -> apical
Note
This is a convenience function provided for generic access to neuron segments. It may have a performance overhead WRT custom-made segment analysis functions that leverage numpy and section-wise iteration.