MorphologicalAttributeFilters
Public API documentation
Loading...
Searching...
No Matches
UnrestrictedResidualTreeBuilder.hpp
Go to the documentation of this file.
1#pragma once
2
10#include "detail/SynchronizedResidualTreeEvolution.hpp"
11
12#include <span>
13#include <utility>
14
15namespace mmcfilters::sdrt {
16
26template <AltitudeValue T> class UnrestrictedResidualTreeBuilder {
27 public:
28 using Altitude = T;
31
39
46 void build(const ImagePointer& image, Tree&& minTree, Tree&& maxTree) {
47 implementation_.build(image, std::move(minTree), std::move(maxTree));
48 }
49
51 [[nodiscard]] int rows() const { return implementation_.rows(); }
53 [[nodiscard]] int columns() const { return implementation_.columns(); }
55 [[nodiscard]] NodeId root() const { return implementation_.root(); }
57 [[nodiscard]] const RegularGridAdjacency2D& adjacency() const noexcept { return implementation_.adjacency(); }
59 [[nodiscard]] const SpatialOrder& spatialOrder() const noexcept { return implementation_.spatialOrder(); }
61 [[nodiscard]] std::span<const NodeId> parents() const { return implementation_.parents(); }
63 [[nodiscard]] std::span<const NodeId> smallestNodeMap() const { return implementation_.smallestNodeMap(); }
65 [[nodiscard]] std::span<const Altitude> nodeAltitudes() const { return implementation_.nodeAltitudes(); }
67 [[nodiscard]] const ResidualTreeBuildStatistics& statistics() const { return implementation_.statistics(); }
68
74 [[nodiscard]] mmcfilters::detail::ValidatedNativeHierarchy<Altitude> takeValidatedHierarchy(MorphologicalTreeSemantics semantics) && {
75 return std::move(implementation_).takeValidatedHierarchy(std::move(semantics));
76 }
77
78 private:
79 detail::SynchronizedResidualTreeEvolution<Altitude, false> implementation_;
80};
81
82} // namespace mmcfilters::sdrt
Minimal correctness-oriented diagnostics for residual-tree construction.
Public construction policies and option objects for residual trees.
Immutable regular-grid 2D adjacency with allocation-free traversal.
Total order over the pixels of one construction domain.
Builds the unrestricted residual tree from synchronized component trees.
void build(const ImagePointer &image, Tree &&minTree, Tree &&maxTree)
Consumes synchronized min-tree and max-tree seeds.
UnrestrictedResidualTreeBuilder(RegularGridAdjacency2D adjacency, UnrestrictedResidualTreeOptions options={})
Creates a reusable unrestricted builder from an extensible option object.
mmcfilters::detail::ValidatedNativeHierarchy< Altitude > takeValidatedHierarchy(MorphologicalTreeSemantics semantics) &&
Transfers the completed result into validated native storage.
const RegularGridAdjacency2D & adjacency() const noexcept
Owning result for one computed scalar attribute layout and buffer.
Immutable scientific interpretation attached to one morphological tree.
Diagnostics retained by the synchronized min-tree/max-tree builders.
Options that affect unrestricted residual-tree construction.