morphoclass.transforms.augmentors.add_nodes_at_intervals module

Implementation of the AddNodesAtIntervals transform.

class morphoclass.transforms.augmentors.add_nodes_at_intervals.AddNodesAtIntervals(interval)

Bases: object

Add points to reduced tree at given interval distance.

The reduced apical tree specified by the point mask, is enhanced by adding additional points from the original apical tree.

First it is checked that all branching points are set. Then all points are added that are further away from those that are already set by the given interval distance.

Parameters

interval (float) – Threshold distance at which a new point is added.

add_nodes(apical, mask)

Add nodes to the mask according to the interval configuration.

Parameters
  • apical (tmd.Tree.Tree.Tree) – An apical tree.

  • mask (np.ndarray) – The mask to set. The data in this array will be modified in-place.