|
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createMaxTree (ImagePtr< T > img, double radius=1.5) |
| | Builds a typed valuedTree max-tree from an image.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createMaxTree (ImagePtr< T > img, RegularGridAdjacency2D adjacency) |
| | Builds a max-tree with an explicit regular-grid 2D adjacency.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createMinTree (ImagePtr< T > img, double radius=1.5) |
| | Builds a typed valuedTree min-tree from an image.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createMinTree (ImagePtr< T > img, RegularGridAdjacency2D adjacency) |
| | Builds a min-tree with an explicit regular-grid 2D adjacency.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createExtremumResidualTree (ImagePtr< T > img, RegularGridAdjacency2D adjacency) |
| | Builds the extremum residual tree through synchronized component trees.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createExtremumResidualTree (ImagePtr< T > img, double radius=1.5) |
| | Builds the extremum residual tree through synchronized component trees with a radius adjacency.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createExtremumResidualTreeByCTs (ImagePtr< T > img, RegularGridAdjacency2D adjacency) |
| | Builds the extremum residual tree by synchronized component trees.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createExtremumResidualTreeByCTs (ImagePtr< T > img, double radius=1.5) |
| | Builds the extremum residual tree with a radius adjacency.
|
| |
| template<class Altitude = std::uint8_t> |
| static ValuedMorphologicalTree< Altitude > | createTreeOfShapes (ImageUInt8Ptr img, TopographicConvention convention={}) |
| | Builds a valued tree of shapes from an 8-bit image.
|
| |
| template<AltitudeValue T> |
| static ValuedMorphologicalTree< T > | createFromHigraParent (std::span< const NodeId > parent, std::span< const T > nodeAltitudes, int rows, int columns, MorphologicalTreeKind kind, std::optional< RegularGridAdjacency2D > adjacency=std::nullopt) |
| | Imports a static Higra parent/altitude hierarchy.
|
| |
Public construction facade for all high-level morphological trees.
MorphologicalTreeFactory is the single public entry point for creating tree instances from images and static Higra hierarchies. The factory owns only construction orchestration; it does not store mutable build state and every construction method returns a fully initialized valued-tree owner.
Design contract:
- builders whose nodes may have an empty proper part supply explicit node altitudes together with their native topology;
- Higra imports preserve the external Higra node-id domain for altitude mapping, then expose the result through the internal dense
NodeId domain;
- callers that only need topology should use
ValuedMorphologicalTree<std::uint8_t>::topology() instead of constructing a bare MorphologicalTree directly;
- max/min image factories derive altitude type from the image type.
uint8_t uses counting sort; other supported altitude values use comparison sort;
- static Higra imports can preserve a non-canonical altitude type because the altitude array itself supplies that type.
Keeping construction in this factory prevents MorphologicalTree and ValuedMorphologicalTree<std::uint8_t> from depending on public factory logic while still allowing their tag-based constructors to remain available for header-only composition inside this library.
Definition at line 50 of file MorphologicalTreeFactory.hpp.
template<AltitudeValue T>
Imports a static Higra parent/altitude hierarchy.
Higra arrays use one compact id domain containing leaves followed by internal nodes. For an image domain with rows * columns leaves, leaf ids are [0, rows * columns) and internal ids are [rows * columns, parent.size()). Every leaf must point to an internal node, every internal node must point to another internal node or to itself, and exactly one internal node must be self-parented as the root.
- Parameters
-
| parent | Parent array in the compact Higra id domain. |
| nodeAltitudes | Altitudes in the same compact Higra id domain. |
| rows | Number of rows in the image/pixel domain. |
| columns | Number of columns in the image/pixel domain. |
| kind | Semantic tree kind represented by the imported hierarchy. |
| adjacency | Required for max-tree and min-tree imports. Optional for tree-of-shapes imports, whose topology can be interpreted without a component-tree adjacency relation. |
- Returns
- A typed valued tree whose internal altitude buffer has already been remapped from Higra ids to internal
NodeId slots.
- Exceptions
-
| std::invalid_argument | if the hierarchy is malformed, if the altitude domain does not match the parent domain, or if a max/min import does not provide adjacency. |
Definition at line 268 of file MorphologicalTreeFactory.hpp.
template<
class Altitude = std::uint8_t>
Builds a valued tree of shapes from an 8-bit image.
The published altitude type must match the altitude encoding declared by the convention. The default convention selects the canonical minimum-4/maximum-8 complementary-grid immersion without domain padding, uses infinity pixel zero, and publishes unchanged 8-bit source levels. ToSGrayLevel altitudes are available under TopographicAltitudeEncoding::ExactDoubled. A self-dual span immersion requires that encoding when it retains an exterior ring; without the ring, TopographicAltitudeEncoding::UInt8 is also exact and admissible.
- Template Parameters
-
| Altitude | Published node-altitude type. |
- Parameters
-
| img | Non-null, non-empty image. |
| convention | Complete topographic convention retained by the result. |
- Returns
- A
ValuedMorphologicalTree<Altitude> whose topology is a tree of shapes and whose altitude buffer is indexed by internal NodeId.
- Exceptions
-
| std::invalid_argument | if the image domain or ToS parameters are rejected by the underlying builder, or if Altitude contradicts the declared altitude encoding. |
Definition at line 235 of file MorphologicalTreeFactory.hpp.