neurom.iter_sections

neurom.iter_sections(neurites, iterator_type=<unbound method Tree.ipreorder>, neurite_filter=None)[source]

Iterator to the sections in a neurite, neuron or neuron population.

Parameters:
  • neurites – neuron, population, neurite, or iterable containing neurite objects
  • iterator_type – type of the iteration (ipreorder, iupstream, ibifurcation_point)
  • neurite_filter – optional top level filter on properties of neurite neurite objects.

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)]