neurom.core.tree

Generic tree class and iteration functions.

Classes

Tree

Simple recursive tree class.

class neurom.core.tree.Tree[source]

Bases: object

Simple recursive tree class.

add_child(tree)[source]

Add a child to the list of this tree’s children.

This tree becomes the added tree’s parent

ibifurcation_point(iter_mode=<function Tree.ipreorder>)[source]

Iterator to bifurcation points. Returns a tree object.

Parameters
  • tree – the tree over which to iterate

  • iter_mode – iteration mode. Default: ipreorder.

iforking_point(iter_mode=<function Tree.ipreorder>)[source]

Iterator to forking points. Returns a tree object.

Parameters
  • tree – the tree over which to iterate

  • iter_mode – iteration mode. Default: ipreorder.

ileaf()[source]

Iterator to all leaves of a tree.

ipostorder()[source]

Depth-first post-order iteration of tree nodes.

ipreorder()[source]

Depth-first pre-order iteration of tree nodes.

is_bifurcation_point()[source]

Is tree a bifurcation point?.

is_forking_point()[source]

Is tree a forking point?.

is_leaf()[source]

Is tree a leaf?.

is_root()[source]

Is tree the root node?.

iupstream()[source]

Iterate from a tree node to the root nodes.