|
MorphologicalAttributeFilters
Public API documentation
|
This guide distinguishes the edge-indexed hierarchy and shape-space saliency operators exposed by mmcfilters. It defines their inputs, outputs, validity, determinism, and complexity contracts.
| Need | API | Result |
|---|---|---|
| project a monotone node valuation | HierarchySaliencyMap::computeSaliencyEdgeMap | value on every graph edge |
| rank only values realized on graph transitions | computeCanonicalRankedSaliencyEdgeMap | ranked value on every graph edge |
| use structural hierarchy levels | computeTopologicalLevelEdgeMap | ranked value on every graph edge |
| normalize max-tree or min-tree altitude | computeNormalizedAltitudeEdgeMap | value in [0, 1] on every graph edge |
| build a persistence hierarchy from extinction values | ExtinctionValues::computeFormalSaliencyEdgeMap | value on every graph edge |
| project the max-propagated extinction valuation directly | computeMonotoneExtinctionProjection | value on every graph edge |
| draw selected extinction cutoff contours | ExtinctionValues::contourMap | pixel visualization |
| compute extinction from an arbitrary tree-node attribute | ShapeSpaceSaliency | value on every graph edge |
contourMap is a raster visualization; it is not an edge-indexed hierarchy saliency map.
Let \(E\) be a finite pixel domain and \(G=(E,\mathcal{A})\) an undirected graph. A rooted hierarchy is
\[ \mathcal{T}=(\mathcal{V},r,{\rm par}), \]
where every pixel \(p\in E\) has one smallest node \(P(p)\in\mathcal{V}\). A compatible valuation \(h:\mathcal{V}\rightarrow\mathbb{R}_{\ge 0}\) is non-decreasing toward the root:
\[ h({\rm par}(v))\ge h(v). \]
For an edge \(\{p,q\}\), let \(a={\rm LCA}(P(p),P(q))\) be the lowest common ancestor (LCA). Under HierarchyLevelConvention::EdgeSaliencyValue,
\[ \Phi_h(\{p,q\})= \left\{\begin{array}{ll} 0, & P(p)=P(q),\\ h(a), & P(p)\ne P(q). \end{array}\right. \]
Under PartitionAppearanceLevel, a transition edge receives \(h(a)-1\). These conventions represent a supplied hierarchy on the graph; they do not construct a hierarchy from arbitrary graph-edge weights.
HierarchySaliencyMap enumerates each undirected adjacency edge once, obtains its endpoints' smallest nodes, computes their LCA, and writes the selected hierarchy level. EdgeSaliencyMap<T> stores parallel sources, targets, and values arrays with image-domain metadata.
Edges whose endpoints have the same smallest node are present with value zero. Formal valuations must therefore be finite and non-negative. Equal parent/child levels are accepted by AllowLevelCollapse; RequireStrictHierarchy rejects them.
Use:
rankHierarchyValuation for dense ranks over all live nodes;computeCanonicalRankedSaliencyEdgeMap for dense ranks over values realized on graph transitions;computeTopologicalLevelEdgeMap for a structural scale;computeNormalizedAltitudeEdgeMap for polarity-aware max-tree or min-tree altitude in [0, 1].The normalized-altitude operation requires one global max-tree or min-tree polarity. A self-dual residual tree or a tree of shapes may instead use a supplied non-decreasing structural or attribute valuation.
For component trees, ComponentTreePartitionHierarchyAdapter completes the partial-partition interpretation: pixel singletons form partition zero, same-smallest-node zero edges form proper-part atoms, and component nodes merge those atoms with child supports.
ExtinctionValues<T, Real> computes one record per component-tree leaf. Each record contains the leaf, its cutoff node, and its extinction. The dominant extremum receives the finite ordering sentinel std::numeric_limits<Real>::max().
computeFormalSaliencyEdgeMap constructs an edge hierarchy in five steps:
\[ {\rm pers}(L,R)=\min(M_L,M_R), \qquad M_{L\cup R}=\max(M_L,M_R), \]
where \(M_L\) and \(M_R\) are maximum descendant extinctions;
computeMonotoneExtinctionProjection performs a different operation: it max-propagates extinction values over the supplied component tree and projects that monotone valuation directly by LCA.
ShapeSpaceSaliency accepts an arbitrary finite floating-point attribute on the live nodes of an input tree. It treats those nodes as graph vertices and the parent/child relations as graph edges. Equal-valued connected nodes form plateaus; regional minima or maxima receive finite extinction values in this second graph.
The result is projected by maximum on original-region contours rather than by the LCA value. If \(s(v)\ge0\) is the score of region \(v\), then
\[ w(\{p,q\})= \max\{s(v)\mid \{p,q\}\subseteq\partial C(v)\}. \]
Equivalently, the maximum is taken over the two smallest-node-to-LCA paths, excluding the LCA. Use this operation when the input attribute is not a monotone valuation of the original hierarchy.
All operations require a committed rooted topology. Cached views and helper objects reject use after topology mutation.
NodeId; live values consumed by an operation must be finite.Invalid domains, disconnected supports, stale topology, invalid LCAs, negative formal values, and non-finite values are rejected.
NodeId, then increasing leaf NodeId.NodeId.These rules make results reproducible without claiming mathematical uniqueness under other valid tie policies.
A threshold cut at \(\lambda\) selects edges with \(w(e)\ge\lambda\). Edges with \(w(e)<\lambda\) define the associated quasi-flat-zone components.
HierarchySaliencyMapProjection::edgeMapToPixelImage aggregates incident edge values for display. ExtinctionValues::contourMap draws selected cutoff-node contours. Neither raster should be compared with an edge map without stating the aggregation rule.
Let \(m=|\mathcal{V}|\) be the number of live nodes, \(p=|E|\) the number of proper parts, \(e=|\mathcal{A}|\) the number of graph edges, and \(l\) the number of component-tree leaves.
| Operation | Time | Auxiliary memory including output where noted |
|---|---|---|
| hierarchy-connectivity validation | O(m + p + e) | O(m + p + e) |
| direct LCA projection | linear preprocessing plus O(e) | O(m + e) including output |
| extinction persistence map | O(e log e + p log p) plus linear terms | O(m + p + e) |
| extinction record construction | conservative O(lm) | O(m + l) |
| shape-space extinction | O(m log m) | O(m) excluding results |
| shape-space contour projection | O(m log m + e log m) | O(m log m + e) including output |
| Operation | C++ | Python |
|---|---|---|
| direct LCA projection | HierarchySaliencyMap::computeSaliencyEdgeMap | HierarchySaliencyMap.compute_saliency_edge_map |
| canonical transition ranks | computeCanonicalRankedSaliencyEdgeMap | compute_canonical_ranked_saliency_edge_map |
| extinction persistence | ExtinctionValues::computeFormalSaliencyEdgeMap | extinction.compute_formal_saliency_edge_map |
| direct extinction projection | computeMonotoneExtinctionProjection | extinction.compute_monotone_extinction_projection |
| cutoff contour visualization | ExtinctionValues::contourMap | extinction.contour_map |
| shape-space extinction | ShapeSpaceSaliency | mmcfilters.ShapeSpaceSaliency |
| cuts and display | HierarchySaliencyMapProjection | mmcfilters.HierarchySaliencyMapProjection |