neurom.core.types

Type enumerations.

Module Attributes

NEURITES

Collection of all neurite types

Functions

axon_filter(n)

Select only axons.

dendrite_filter(n)

Select only dendrites.

is_composite_type(subtype)

Check that the given type is composite.

tree_type_checker(*ref)

Tree type checker functor.

Classes

NeuriteIter(value)

Neurite iteration orders.

NeuriteType(value[, names, module, ...])

Type of neurite.

neurom.core.types.NEURITES = (NeuriteType.axon, NeuriteType.apical_dendrite, NeuriteType.basal_dendrite)

Collection of all neurite types

class neurom.core.types.NeuriteIter(value)

Neurite iteration orders.

class neurom.core.types.NeuriteType(value, names=None, *, module=None, qualname=None, type=None, start=1)

Type of neurite.

is_composite()

Return True if the type consists of more than 1 subtypes.

neurom.core.types.axon_filter(n)

Select only axons.

neurom.core.types.dendrite_filter(n)

Select only dendrites.

neurom.core.types.is_composite_type(subtype)

Check that the given type is composite.

neurom.core.types.tree_type_checker(*ref)

Tree type checker functor.

Parameters:

*ref (NeuriteType|tuple) – Either a single NeuriteType, list of them or a tuple of them.

Returns:

Functor that takes a tree, and returns true if that tree matches any of NeuriteTypes in ref

Ex:
>>> import neurom
>>> from neurom.core.types import NeuriteType, tree_type_checker
>>> from neurom.core.morphology import Section, iter_neurites
>>> m = neurom.load_morphology("tests/data/swc/Neuron.swc")
>>>
>>> tree_filter = tree_type_checker(NeuriteType.axon, NeuriteType.basal_dendrite)
>>> it = iter_neurites(m, filt=tree_filter)
>>>
>>> tree_filter = tree_type_checker((NeuriteType.axon, NeuriteType.basal_dendrite))
>>> it = iter_neurites(m, filt=tree_filter)