Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 3.42 KB

tree_code_overview.md

File metadata and controls

84 lines (64 loc) · 3.42 KB

Core Technical Guide

This document summarizes only the published main line of MorphoTreeAdjust.

For public use, read first:

Code Map

The central points of the repository are:

Structural Reading

The main code flow can be read as follows:

  1. AdjacencyRelation defines the domain and connectivity.
  2. DynamicComponentTree materializes the base dynamic tree.
  3. AttributeComputer and the dynamic attributes track the nodes.
  4. DualMinMaxTreeIncrementalFilter and DualMinMaxTreeIncrementalFilterLeaf update the dual tree after pruning in the primal tree.
  5. ComponentTreeCasf organizes that mechanism to apply CASF.
  6. morphoTreeAdjust.cpp exposes the same layer to Python.

Cost Hotspots

The most important costs in the repository today are in:

  • initial construction of DynamicComponentTree;
  • incremental update executed by DualMinMaxTreeIncrementalFilter;
  • the leaf-based variant in DualMinMaxTreeIncrementalFilterLeaf;
  • repeated filter application in ComponentTreeCasf.

In practical terms:

  • the leaf variant usually increases the number of processed events;
  • the subtree variant usually concentrates more work per event;
  • the cost difference depends on the image, the polarity, and the CASF threshold schedule.

Where To Inspect Behavior

To study or validate the core, the most useful places are:

Suggested Reading Order

If you want to understand the repository core in sequence:

  1. MorphoTreeAdjust.hpp
  2. DynamicComponentTree.hpp
  3. AttributeComputer.hpp
  4. DualMinMaxTreeIncrementalFilter.hpp
  5. DualMinMaxTreeIncrementalFilterLeaf.hpp
  6. ComponentTreeCasf.hpp
  7. morphoTreeAdjust.cpp