neurom.core._neuron.iter_neurites

neurom.core._neuron.iter_neurites(obj, mapfun=None, filt=None)[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.

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