|
mmcfilters
Public API documentation
|
Validates and transforms hierarchy valuations used by saliency maps. More...
#include <HierarchySaliencyMapValidation.hpp>
Static Public Member Functions | |
| static void | validateHierarchyConnectivity (const MorphologicalTree &tree, const RegularGridAdjacency2D &adjacency, const char *context="HierarchySaliencyMapValidation::validateHierarchyConnectivity") |
Validates that every hierarchy support is connected in adjacency. | |
| template<class Value > | |
| static void | validateHierarchyValuation (const MorphologicalTree &tree, std::span< const Value > valuation, HierarchyValuationPolicy policy=HierarchyValuationPolicy::AllowLevelCollapse, HierarchyValuationRangePolicy rangePolicy=HierarchyValuationRangePolicy::AllowAnyFinite, const char *context="HierarchySaliencyMapValidation::validateHierarchyValuation") |
| Validates that a node-indexed valuation is compatible with a hierarchy. | |
| template<class Value > | |
| static std::vector< int > | rankHierarchyValuation (const MorphologicalTree &tree, std::span< const Value > valuation, HierarchyValuationPolicy policy=HierarchyValuationPolicy::AllowLevelCollapse) |
| Converts a compatible valuation to dense non-negative integer levels. | |
| template<class Value > | |
| static std::vector< double > | computeNormalizedScores (const MorphologicalTree &tree, std::span< const Value > valuation, HierarchyValuationPolicy policy=HierarchyValuationPolicy::AllowLevelCollapse, HierarchyValuationRangePolicy rangePolicy=HierarchyValuationRangePolicy::AllowAnyFinite) |
Normalizes a compatible hierarchy valuation to [0, 1]. | |
| template<AltitudeValue T> | |
| static std::vector< double > | computeNormalizedScores (const ValuedMorphologicalTree< T > &tree) |
Computes a dense normalized altitude score buffer in [0, 1]. | |
Validates and transforms hierarchy valuations used by saliency maps.
A hierarchy valuation assigns one scalar level to each internal tree node. It is compatible with the quasi-flat-zone saliency definition when it is non-decreasing along the ancestry order:
valuation(parent) >= valuation(child)
This class centralizes checks and monotone reparameterizations of that valuation. It does not project the hierarchy onto graph edges; use HierarchySaliencyMap for the formal edge-indexed saliency map.
Definition at line 154 of file HierarchySaliencyMapValidation.hpp.
|
inlinestatic |
Normalizes a compatible hierarchy valuation to [0, 1].
The input valuation is validated first, so it must be finite for floating-point types and monotone along the hierarchy according to policy. The returned double buffer preserves the input order with an increasing affine transform over live-node values:
normalized(node) = (valuation(node) - minLiveValue) / range
Equal-valued adjacent levels therefore remain collapsed. If every live node has the same valuation, all normalized values are zero. The computation avoids forming an overflowing maxLiveValue - minLiveValue when finite floating-point extrema span both signs, and clamps round-off at the output boundaries so every returned live-node score remains in [0, 1].
| tree | Tree topology. |
| valuation | Node valuation. |
| policy | Policy controlling the operation. |
| rangePolicy | Policy for values outside the supported range. |
Definition at line 422 of file HierarchySaliencyMapValidation.hpp.
|
inlinestatic |
Computes a dense normalized altitude score buffer in [0, 1].
The altitude is first converted to a hierarchy-compatible valuation: max-tree altitudes are inverted, while min-tree altitudes keep their natural coarse-to-fine order. The generic computeNormalizedScores helper then normalizes that valuation. Trees without a single component-tree polarity are rejected.
| tree | Tree topology. |
Definition at line 491 of file HierarchySaliencyMapValidation.hpp.
|
inlinestatic |
Converts a compatible valuation to dense non-negative integer levels.
Cousty et al. state saliency maps on an integer level range. This helper keeps the caller's hierarchy scale order but re-encodes the distinct live-node valuation values as dense ranks 0..k-1. Equal valuation values receive the same rank, so level collapse is preserved. The input is validated before ranking; floating-point values must be finite and the selected hierarchy monotonicity policy is enforced.
| tree | Tree topology. |
| valuation | Node valuation. |
| policy | Policy controlling the operation. |
Definition at line 375 of file HierarchySaliencyMapValidation.hpp.
|
inlinestatic |
Validates that every hierarchy support is connected in adjacency.
Each image-domain edge is assigned to the LCA of its endpoint smallest nodes. Nodes are then processed in post-order. At a node, all edges assigned to it are inserted into one disjoint-set forest; the node is connected if its direct proper parts and already-connected child supports have one common representative. This simultaneously validates the completed hierarchy in which every direct proper-part region is a finest graph region.
| tree | Hierarchy topology and smallest-node mapping. |
| adjacency | Graph defining connectedness. |
| context | Operation name used in diagnostics. |
| std::invalid_argument | If the graph domain differs from the tree or any live-node support is disconnected. |
Definition at line 197 of file HierarchySaliencyMapValidation.hpp.
|
inlinestatic |
Validates that a node-indexed valuation is compatible with a hierarchy.
This is the contract required by the saliency map definition based on quasi-flat zones. The valuation supplies the hierarchy scale; the tree supplies the nested regions. A compatible valuation is defined for every dense internal NodeId slot and is monotone along every live parent-child relation. Floating-point valuations must also be finite.
AllowLevelCollapse accepts valuation(parent) >= valuation(child). The resulting edge map is a formal saliency map for the hierarchy after merging any adjacent levels with equal valuation. RequireStrictHierarchy requires valuation(parent) > valuation(child) and should be used when the edge map must recover every explicit level of the current tree.
| tree | Tree topology. |
| valuation | Node valuation. |
| policy | Policy controlling the operation. |
| rangePolicy | Policy for values outside the supported range. |
| context | Operation context or diagnostic label. |
Definition at line 326 of file HierarchySaliencyMapValidation.hpp.