neurom.ezy.neuron.Neuron.iter_neurites¶
-
Neuron.
iter_neurites
(iterator_type, mapping=None, neurite_type=<TreeType.all: 32>)¶ Iterate over collection of neurites applying iterator_type
Parameters: - iterator_type – Type of iterator with which to perform the iteration. (e.g. isegment, isection, i_section_path_length)
- mapping – mapping function to be applied to the target of iteration. (e.g. segment_length). Must be compatible with the iterator_type.
- neurite_type – TreeType object. Neurites of incompatible type are filtered out.
Returns: Iterator of mapped iteration targets.
Example
Get the total volume of all neurites in the cell and the total length or neurites from their segments.
>>> from neurom import ezy >>> from neurom.analysis import morphmath as mm >>> from neurom.core import tree as tr >>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc') >>> v = sum(nrn.iter_neurites(tr.isegment, mm.segment_volume)) >>> tl = sum(nrn.iter_neurites(tr.isegment, mm.segment_length)))