neurom.features.neuritefunc¶
Neurite functions.
Functions
Partition at bifurcation points of a collection of neurites. |
|
Get the convex hull of an object containing points. |
|
Calculate the diameter power relation at a bifurcation point. |
|
Compute the total downstream length starting from a section. |
|
Returns the list of distances between consecutive points. |
|
Tree type checker functor. |
|
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. |
|
Get a list of local bifurcation angles in a collection of neurites. |
|
Map fun to all the neurites in a single or collection of neurons. |
|
Map func to all the segments in a collection of neurites. |
|
Number of bifurcation points in a collection of neurites. |
|
Number of forking points in a collection of neurites. |
|
Number of leaves points in a collection of neurites. |
|
Number of neurites in a collection of neurites. |
|
Number of sections in a collection of neurites. |
|
Number of segments in a collection of neurites. |
|
Get the path length per neurite in a collection. |
|
Get the volume density per neurite. |
|
Number of bifurcation points in a collection of neurites. |
|
Number of forking points in a collection of neurites. |
|
Number of neurites in a collection of neurites. |
|
Number of sections in a collection of neurites. |
|
Get the number of sections per neurite in a collection of neurites. |
|
Number of sections in a collection of neurites. |
|
Number of leaves points in a collection of neurites. |
|
Partition asymmetry at bifurcation points of a collection of neurites. |
|
Calculate the partition asymmetry at a bifurcation point. |
|
Partition pairs at bifurcation points of a collection of neurites. |
|
Principal direction extent of neurites in neurons. |
|
Get a list of remote bifurcation angles in a collection of neurites. |
|
Section areas in a collection of neurites. |
|
Bifurcation section branch orders in a collection of neurites. |
|
Bifurcation section lengths in a collection of neurites. |
|
Get the radial distances of the bifurcation sections for a collection of neurites. |
|
Section branch orders in a collection of neurites. |
|
Section end to end distances in a collection of neurites. |
|
Section lengths in a collection of neurites. |
|
Path lengths of a collection of neurites. |
|
Section radial distances in a collection of neurites. |
|
Inter-segment opening angles in a section. |
|
Diameter taper rates of the sections in a collection of neurites from root to tip. |
|
Termination section branch orders in a collection of neurites. |
|
Termination section lengths in a collection of neurites. |
|
Get the radial distances of the termination sections for a collection of neurites. |
|
Section tortuosities in a collection of neurites. |
|
Section volumes in a collection of neurites. |
|
Areas of the segments in a collection of neurites. |
|
Lengths of the segments in a collection of neurites. |
|
Inter-segment opening angles in a section. |
|
Return a list of segment mid-points in a collection of neurites. |
|
Returns pathlengths between all non-root points and their root point. |
|
Returns the list of distances between all segment mid points and origin. |
|
Arithmetic mean of the radii of the points in segments in a collection of neurites. |
|
Diameters taper rates of the segments in a collection of neurites. |
|
Volumes of the segments in a collection of neurites. |
|
Sibling ratios at bifurcation points of a collection of neurites. |
|
Get the path lengths to each terminal point per neurite in a collection. |
|
Surface area in a collection of neurites. |
|
Get the total length of all sections in the group of neurons or neurites. |
|
Get the path length per neurite in a collection. |
|
Get the volume per neurite in a collection. |
Classes
Column labels for internal data representation. |
|
Enum representing valid tree types. |
|
Simple recursive tree class. |
-
class
neurom.features.neuritefunc.
COLS
[source]¶ Bases:
object
Column labels for internal data representation.
-
class
neurom.features.neuritefunc.
NeuriteType
(value)[source]¶ Bases:
neurom.utils.OrderedEnum
Enum representing valid tree types.
-
class
neurom.features.neuritefunc.
Tree
[source]¶ Bases:
object
Simple recursive tree class.
-
add_child
(tree)[source]¶ Add a child to the list of this tree’s children.
This tree becomes the added tree’s parent
-
ibifurcation_point
(iter_mode=<function Tree.ipreorder>)[source]¶ Iterator to bifurcation points. Returns a tree object.
- Parameters
tree – the tree over which to iterate
iter_mode – iteration mode. Default: ipreorder.
-
-
neurom.features.neuritefunc.
bifurcation_partitions
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Partition at bifurcation points of a collection of neurites.
-
neurom.features.neuritefunc.
convex_hull
(obj)[source]¶ Get the convex hull of an object containing points.
- Returns
scipy.spatial.ConvexHull object built from obj.points
-
neurom.features.neuritefunc.
diameter_power_relations
(neurites, neurite_type=<NeuriteType.all: 32>, method='first')[source]¶ Calculate the diameter power relation at a bifurcation point.
Diameter power relation is defined in https://www.ncbi.nlm.nih.gov/pubmed/18568015
This quantity gives an indication of how far the branching is from the Rall ratio (when =1).
-
neurom.features.neuritefunc.
downstream_pathlength
(section)[source]¶ Compute the total downstream length starting from a section.
-
neurom.features.neuritefunc.
interval_lengths
(points, prepend_zero=False)[source]¶ Returns the list of distances between consecutive points.
- Parameters
points – a list of np.array of 3D points
prepend_zero (bool) – if True, the returned array will start with a zero
-
neurom.features.neuritefunc.
is_type
(*ref)¶ Tree type checker functor.
- Returns
Functor that takes a tree, and returns true if that tree matches any of NeuriteTypes in ref
- Ex:
>>> from neurom.core.types import NeuriteType, tree_type_checker >>> tree_filter = tree_type_checker(NeuriteType.axon, NeuriteType.basal_dendrite) >>> nrn.i_neurites(tree.isegment, tree_filter=tree_filter)
-
neurom.features.neuritefunc.
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.features.neuritefunc.
iter_sections
(neurites, iterator_type=<function Tree.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: Tree.ipreorder: Depth-first pre-order iteration of tree nodes Tree.ipostorder: Depth-first post-order iteration of tree nodes Tree.iupstream: Iterate from a tree node to the root nodes Tree.ibifurcation_point: Iterator to bifurcation points Tree.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.features.neuritefunc.
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.
-
neurom.features.neuritefunc.
local_bifurcation_angles
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Get a list of local bifurcation angles in a collection of neurites.
-
neurom.features.neuritefunc.
map_neurons
(fun, neurites, neurite_type)[source]¶ Map fun to all the neurites in a single or collection of neurons.
-
neurom.features.neuritefunc.
map_segments
(func, neurites, neurite_type)[source]¶ Map func to all the segments in a collection of neurites.
func accepts a section and returns list of values corresponding to each segment.
-
neurom.features.neuritefunc.
n_bifurcation_points
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of bifurcation points in a collection of neurites.
-
neurom.features.neuritefunc.
n_forking_points
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of forking points in a collection of neurites.
-
neurom.features.neuritefunc.
n_leaves
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of leaves points in a collection of neurites.
-
neurom.features.neuritefunc.
n_neurites
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of neurites in a collection of neurites.
-
neurom.features.neuritefunc.
n_sections
(neurites, neurite_type=<NeuriteType.all: 32>, iterator_type=<function Tree.ipreorder>)[source]¶ Number of sections in a collection of neurites.
-
neurom.features.neuritefunc.
n_segments
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of segments in a collection of neurites.
-
neurom.features.neuritefunc.
neurite_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Get the path length per neurite in a collection.
-
neurom.features.neuritefunc.
neurite_volume_density
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Get the volume density per neurite.
The volume density is defined as the ratio of the neurite volume and the volume of the neurite’s enclosing convex hull
Note
Returns np.nan if the convex hull computation fails.
-
neurom.features.neuritefunc.
number_of_bifurcations
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of bifurcation points in a collection of neurites.
-
neurom.features.neuritefunc.
number_of_forking_points
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of forking points in a collection of neurites.
-
neurom.features.neuritefunc.
number_of_neurites
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of neurites in a collection of neurites.
-
neurom.features.neuritefunc.
number_of_sections
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of sections in a collection of neurites.
-
neurom.features.neuritefunc.
number_of_sections_per_neurite
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Get the number of sections per neurite in a collection of neurites.
-
neurom.features.neuritefunc.
number_of_segments
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of sections in a collection of neurites.
-
neurom.features.neuritefunc.
number_of_terminations
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Number of leaves points in a collection of neurites.
-
neurom.features.neuritefunc.
partition_asymmetries
(neurites, neurite_type=<NeuriteType.all: 32>, variant='branch-order')[source]¶ Partition asymmetry at bifurcation points of a collection of neurites.
Variant: length is a different definition, as the absolute difference in downstream path lenghts, relative to the total neurite path length
-
neurom.features.neuritefunc.
partition_asymmetry
(bif_point)[source]¶ Calculate the partition asymmetry at a bifurcation point.
Partition asymmetry is defined in https://www.ncbi.nlm.nih.gov/pubmed/18568015
The number of nodes in each child tree is counted. The partition is defined as the ratio of the absolute difference and the sum of the number of bifurcations in the two child subtrees at each branch point.
-
neurom.features.neuritefunc.
partition_pairs
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Partition pairs at bifurcation points of a collection of neurites.
Partition pair is defined as the number of bifurcations at the two daughters of the bifurcating section
-
neurom.features.neuritefunc.
principal_direction_extents
(neurites, neurite_type=<NeuriteType.all: 32>, direction=0)[source]¶ Principal direction extent of neurites in neurons.
-
neurom.features.neuritefunc.
remote_bifurcation_angles
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Get a list of remote bifurcation angles in a collection of neurites.
-
neurom.features.neuritefunc.
section_areas
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Section areas in a collection of neurites.
-
neurom.features.neuritefunc.
section_bif_branch_orders
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Bifurcation section branch orders in a collection of neurites.
-
neurom.features.neuritefunc.
section_bif_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Bifurcation section lengths in a collection of neurites.
-
neurom.features.neuritefunc.
section_bif_radial_distances
(neurites, neurite_type=<NeuriteType.all: 32>, origin=None)[source]¶ Get the radial distances of the bifurcation sections for a collection of neurites.
-
neurom.features.neuritefunc.
section_branch_orders
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Section branch orders in a collection of neurites.
-
neurom.features.neuritefunc.
section_end_distances
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Section end to end distances in a collection of neurites.
-
neurom.features.neuritefunc.
section_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Section lengths in a collection of neurites.
-
neurom.features.neuritefunc.
section_path_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Path lengths of a collection of neurites.
-
neurom.features.neuritefunc.
section_radial_distances
(neurites, neurite_type=<NeuriteType.all: 32>, origin=None, iterator_type=<function Tree.ipreorder>)[source]¶ Section radial distances in a collection of neurites.
The iterator_type can be used to select only terminal sections (ileaf) or only bifurcations (ibifurcation_point).
-
neurom.features.neuritefunc.
section_strahler_orders
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Inter-segment opening angles in a section.
-
neurom.features.neuritefunc.
section_taper_rates
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Diameter taper rates of the sections in a collection of neurites from root to tip.
Taper rate is defined here as the linear fit along a section. It is expected to be negative for neurons.
-
neurom.features.neuritefunc.
section_term_branch_orders
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Termination section branch orders in a collection of neurites.
-
neurom.features.neuritefunc.
section_term_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Termination section lengths in a collection of neurites.
-
neurom.features.neuritefunc.
section_term_radial_distances
(neurites, neurite_type=<NeuriteType.all: 32>, origin=None)[source]¶ Get the radial distances of the termination sections for a collection of neurites.
-
neurom.features.neuritefunc.
section_tortuosity
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Section tortuosities in a collection of neurites.
-
neurom.features.neuritefunc.
section_volumes
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Section volumes in a collection of neurites.
-
neurom.features.neuritefunc.
segment_areas
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Areas of the segments in a collection of neurites.
-
neurom.features.neuritefunc.
segment_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Lengths of the segments in a collection of neurites.
-
neurom.features.neuritefunc.
segment_meander_angles
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Inter-segment opening angles in a section.
-
neurom.features.neuritefunc.
segment_midpoints
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Return a list of segment mid-points in a collection of neurites.
-
neurom.features.neuritefunc.
segment_path_lengths
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Returns pathlengths between all non-root points and their root point.
-
neurom.features.neuritefunc.
segment_radial_distances
(neurites, neurite_type=<NeuriteType.all: 32>, origin=None)[source]¶ Returns the list of distances between all segment mid points and origin.
-
neurom.features.neuritefunc.
segment_radii
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Arithmetic mean of the radii of the points in segments in a collection of neurites.
-
neurom.features.neuritefunc.
segment_taper_rates
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Diameters taper rates of the segments in a collection of neurites.
The taper rate is defined as the absolute radii differences divided by length of the section
-
neurom.features.neuritefunc.
segment_volumes
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Volumes of the segments in a collection of neurites.
-
neurom.features.neuritefunc.
sibling_ratios
(neurites, neurite_type=<NeuriteType.all: 32>, method='first')[source]¶ Sibling ratios at bifurcation points of a collection of neurites.
The sibling ratio is the ratio between the diameters of the smallest and the largest child. It is a real number between 0 and 1. Method argument allows one to consider mean diameters along the child section instead of diameter of the first point.
-
neurom.features.neuritefunc.
terminal_path_lengths_per_neurite
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Get the path lengths to each terminal point per neurite in a collection.
-
neurom.features.neuritefunc.
total_area_per_neurite
(neurites, neurite_type=<NeuriteType.all: 32>)[source]¶ Surface area in a collection of neurites.
The area is defined as the sum of the area of the sections.
-
neurom.features.neuritefunc.
total_length
(nrn_pop, neurite_type=<NeuriteType.all: 32>)[source]¶ Get the total length of all sections in the group of neurons or neurites.