neurom.core.types

Type enumerations.

Module Attributes

NEURITES

Collection of all neurite types

Functions

axon_filter

Select only axons.

dendrite_filter

Select only dendrites.

tree_type_checker

Tree type checker functor.

Classes

NeuriteIter

Neurite iteration orders.

NeuriteType

Type of neurite.

class neurom.core.types.NeuriteIter(value)[source]

Bases: neurom.utils.OrderedEnum

Neurite iteration orders.

class neurom.core.types.NeuriteType(value)[source]

Bases: enum.IntEnum

Type of neurite.

class neurom.core.types.OrderedEnum(value)[source]

Bases: enum.Enum

An ordered enum class.

Implementation taken here https://docs.python.org/3/library/enum.html#orderedenum

Fixes https://github.com/BlueBrain/NeuroM/issues/697

neurom.core.types.axon_filter(n)[source]

Select only axons.

neurom.core.types.dendrite_filter(n)[source]

Select only dendrites.

neurom.core.types.tree_type_checker(*ref)[source]

Tree type checker functor.

Parameters
  • *ref (NeuriteType|tuple) – Either a single NeuriteType or a variable list of them or a tuple

  • them. (of) –

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.neuron import Section
>>> nrn = neurom.load_neuron('path')
>>>
>>> tree_filter = tree_type_checker(NeuriteType.axon, NeuriteType.basal_dendrite)
>>> nrn.i_neurites(Section.ipreorder, tree_filter=tree_filter)
>>>
>>> tree_filter = tree_type_checker((NeuriteType.axon, NeuriteType.basal_dendrite))
>>> nrn.i_neurites(Section.ipreorder, tree_filter=tree_filter)