|
| static const char * | nodeAltitudeOrderName (NodeAltitudeOrder order) noexcept |
| | Returns the name of a declared node-altitude order.
|
| static bool | hasGlobalMonotoneAltitudeOrder (const MorphologicalTree &tree) noexcept |
| | Tests whether the topology declares a globally monotone altitude order.
|
| static void | requireGlobalMonotoneAltitudeOrder (const MorphologicalTree &tree, const char *context) |
| | Requires a declared globally monotone altitude order.
|
| template<AltitudeValue T> |
| static void | validateNodeAltitudeBufferShape (const MorphologicalTree &tree, std::span< const T > altitude) |
| | Validates that an altitude buffer covers the dense internal-node domain.
|
| template<AltitudeValue T> |
| static void | validateFiniteAltitudeValue (T altitude, std::size_t index, const char *context) |
| | Rejects non-finite floating-point altitudes while compiling to a no-op for integral types.
|
| template<AltitudeValue T> |
| static void | validateFiniteAltitudeValues (std::span< const T > altitude, const char *context) |
| | Rejects non-finite floating-point altitudes in a contiguous input range.
|
| template<AltitudeValue T> |
| static void | validateFiniteImageAltitudes (const ImagePtr< T > &image, const char *context) |
| | Rejects non-finite floating-point pixels before using an image as altitude source.
|
| template<AltitudeValue T> |
| static T | nodeAltitude (std::span< const T > altitude, NodeId nodeId) |
| | Reads one node altitude from an explicit altitude buffer.
|
| template<AltitudeValue T> |
| static AltitudeDifference< T > | nodeResidue (const MorphologicalTree &tree, std::span< const T > altitude, NodeId nodeId) |
| | Computes the altitude difference between one node and its parent.
|
| template<AltitudeValue T> |
| static std::uint8_t | requireUInt8AltitudeValue (T altitude, NodeId nodeId, const char *context) |
| | Converts one altitude value to uint8_t, rejecting values outside the output domain.
|
| template<AltitudeValue T> |
| static void | validateUInt8AltitudeDomain (const MorphologicalTree &tree, std::span< const T > altitude, const char *context) |
| | Validates all live node altitudes before materialising an ImageUInt8.
|
| template<AltitudeValue T> |
| static ImagePtr< T > | reconstructFromNodeAltitudes (const MorphologicalTree &tree, std::span< const T > altitude, const char *context="TreeAltitudeAlgorithms::reconstructFromNodeAltitudes") |
| | Reconstructs a typed image from topology storage and explicit node altitudes.
|
template<class Contribution>
requires (std::is_arithmetic_v<Contribution> && !std::is_same_v<std::remove_cv_t<Contribution>, bool>) |
| static ImagePtr< Contribution > | reconstructFromNodeContributions (const MorphologicalTree &tree, std::span< const Contribution > nodeContributions, const char *context="TreeAltitudeAlgorithms::reconstructFromNodeContributions") |
| | Reconstructs an image by summing node contributions on every root-to-node branch.
|
| template<AltitudeValue T> |
| static std::pair< std::vector< NodeId >, std::vector< T > > | exportHigraHierarchy (const MorphologicalTree &tree, std::span< const T > altitude) |
| | Exports a live rooted topology and explicit altitudes to a compact parent/altitude representation.
|
| template<AltitudeValue T> |
| static void | validateMonotoneNodeAltitudes (const MorphologicalTree &tree, std::span< const T > altitude) |
| | Validates the hierarchy's declared global altitude order.
|
Pure operations over a topology and an explicit altitude buffer.
TreeAltitudeAlgorithms intentionally owns no state. It is the neutral home for algorithms that need only MorphologicalTree + std::span<const T>, leaving ValuedMorphologicalTree<std::uint8_t> as an owner/adaptor for canonical mutable state.
Definition at line 86 of file TreeAltitudeAlgorithms.hpp.
template<class Contribution>
requires (std::is_arithmetic_v<Contribution> && !std::is_same_v<std::remove_cv_t<Contribution>, bool>)
| ImagePtr< Contribution > mmcfilters::TreeAltitudeAlgorithms::reconstructFromNodeContributions |
( |
const MorphologicalTree & | tree, |
|
|
std::span< const Contribution > | nodeContributions, |
|
|
const char * | context = "TreeAltitudeAlgorithms::reconstructFromNodeContributions" ) |
|
inlinestaticnodiscard |
Reconstructs an image by summing node contributions on every root-to-node branch.
The reconstruction baseline is fixed at zero. Therefore the accumulated value at the root is its own contribution, and each non-root accumulated value is the parent accumulation plus the node contribution.
- Parameters
-
| tree | Tree topology indexing the contribution buffer. |
| nodeContributions | Dense contribution buffer indexed by internal node id. |
| context | Operation name used in diagnostics. |
- Returns
- Image whose pixel value is the sum of contributions of all nodes containing that pixel.
Definition at line 303 of file TreeAltitudeAlgorithms.hpp.