|
MorphologicalAttributeFilters
Public API documentation
|
Wrapper pairing MorphologicalTree topology with an external altitude buffer.
More...
#include <WeightedMorphologicalTree.hpp>
Public Types | |
| using | altitude_type = T |
| Altitude scalar type stored by this weighted tree. | |
| using | altitude_buffer = std::vector< T > |
Dense altitude buffer indexed by internal NodeId. | |
Public Member Functions | |
| WeightedMorphologicalTree (const WeightedMorphologicalTree &)=delete | |
| WeightedMorphologicalTree & | operator= (const WeightedMorphologicalTree &)=delete |
| WeightedMorphologicalTree (WeightedMorphologicalTree &&) noexcept=default | |
| Transfers topology and altitude ownership from another weighted tree. | |
| WeightedMorphologicalTree & | operator= (WeightedMorphologicalTree &&) noexcept=default |
| Move-assigns topology and altitude ownership from another weighted tree. | |
| WeightedMorphologicalTree (detail::MorphologicalTreeConstructionTag, MorphologicalTree &&topology, ImagePtr< T > img) | |
| Creates a weighted tree by inferring node altitudes from an image. | |
| WeightedMorphologicalTree (detail::MorphologicalTreeConstructionTag, MorphologicalTree &&topology, detail::AltitudeInput< T > altitude) | |
| Creates a weighted tree from an explicit altitude input view. | |
| void | validateAltitudeBufferShape () const |
| Checks that the altitude buffer covers the dense internal-node domain. | |
| const MorphologicalTree & | topology () const noexcept |
| Returns read-only access to the owned topology. | |
| const altitude_buffer & | getAltitudeBuffer () const noexcept |
Returns the dense altitude buffer indexed by internal NodeId. | |
| AltitudeSpan< T > | altitudeSpan () const noexcept |
| Returns a read-only span over the dense altitude buffer. | |
| WeightedTreeView< T > | asView () const |
| Creates a non-owning weighted view over this owner. | |
| void | setAltitudeBuffer (altitude_buffer altitudeBuffer) |
| Replaces the owned altitude buffer after full validation. | |
| void | setAltitudeBufferUnchecked (altitude_buffer altitudeBuffer) |
| Replaces the owned altitude buffer without checking tree-order monotonicity. | |
| void | validateMonotoneAltitude () const |
| Validates the current altitude buffer against the topology order. | |
| T | getAltitude (NodeId nodeId) const |
| Returns one live node altitude from the dense buffer. | |
| void | setAltitude (NodeId nodeId, T value) |
| Updates one live node altitude with local monotonicity validation. | |
| void | setAltitudeUnchecked (NodeId nodeId, T value) |
| Updates one node altitude without checking tree-order monotonicity. | |
| void | pruneNode (NodeId nodeId) |
| Prunes a complete subtree through the owned topology. | |
| void | mergeNodeIntoParent (NodeId nodeId) |
| Merges one node into its parent through the owned topology. | |
| AltitudeDiff< T > | getNodeResidue (NodeId nodeId) const |
| Returns the altitude difference between a node and its parent. | |
| ImagePtr< T > | reconstructionImage () const |
| Reconstructs an image by assigning each proper part its owner altitude. | |
| std::pair< std::vector< NodeId >, std::vector< T > > | exportHigraHierarchy () const |
| Exports the current live rooted tree to a new compact Higra parent/altitude representation. | |
| WeightedTreeEditor< T > | edit () |
| Opens the only public entrypoint for staged weighted edits. | |
Friends | |
| class | WeightedTreeEditor< T > |
Wrapper pairing MorphologicalTree topology with an external altitude buffer.
WeightedMorphologicalTree owns the mutable topology and node-altitude state internally, indexed by dense internal NodeId. Read-only topology access and weighted convenience methods are exposed without leaking structural mutation. Staged structural edits must go through edit(), which returns a WeightedTreeEditor.
Static Higra imports preserve their original node-id domain until the topology is edited. exportHigraHierarchy() creates a new compact Higra domain for the current live rooted tree.
Definition at line 73 of file WeightedMorphologicalTree.hpp.
| using mmcfilters::WeightedMorphologicalTree< T >::altitude_buffer = std::vector<T> |
Dense altitude buffer indexed by internal NodeId.
Definition at line 81 of file WeightedMorphologicalTree.hpp.
| using mmcfilters::WeightedMorphologicalTree< T >::altitude_type = T |
Altitude scalar type stored by this weighted tree.
Definition at line 78 of file WeightedMorphologicalTree.hpp.
|
inline |
Creates a weighted tree by inferring node altitudes from an image.
The topology must already be built over the same image domain. For each live internal node, the constructor reads one direct proper part owned by that node and copies the corresponding image gray level into the dense altitude buffer.
This constructor is tag-protected because image-to-altitude inference is a construction detail owned by the factory.
Definition at line 200 of file WeightedMorphologicalTree.hpp.
|
inline |
Creates a weighted tree from an explicit altitude input view.
The AltitudeInput::domain field determines whether values are copied directly as internal-node altitudes or remapped from a preserved Higra hierarchy. This is used by Higra import and SDRT materialization paths.
This constructor is tag-protected so callers cannot accidentally bypass the public factory contracts for altitude shape and domain.
Definition at line 226 of file WeightedMorphologicalTree.hpp.
|
inlinenoexcept |
Returns a read-only span over the dense altitude buffer.
Definition at line 266 of file WeightedMorphologicalTree.hpp.
|
inline |
Creates a non-owning weighted view over this owner.
Definition at line 273 of file WeightedMorphologicalTree.hpp.
|
inline |
Opens the only public entrypoint for staged weighted edits.
Definition at line 406 of file WeightedMorphologicalTree.hpp.
|
inline |
Exports the current live rooted tree to a new compact Higra parent/altitude representation.
Attribute buffers are projected through AttributeComputation::projectNodeValuesToExportedHigra() so weighted-tree export remains limited to topology and altitudes.
Definition at line 399 of file WeightedMorphologicalTree.hpp.
|
inline |
Returns one live node altitude from the dense buffer.
Definition at line 319 of file WeightedMorphologicalTree.hpp.
|
inlinenoexcept |
Returns the dense altitude buffer indexed by internal NodeId.
Definition at line 259 of file WeightedMorphologicalTree.hpp.
|
inline |
Returns the altitude difference between a node and its parent.
Definition at line 380 of file WeightedMorphologicalTree.hpp.
|
inline |
Merges one node into its parent through the owned topology.
This is the weighted counterpart of the safe public topology mutator. Dead slots keep stale altitude values until a compact export is requested.
Definition at line 372 of file WeightedMorphologicalTree.hpp.
|
inline |
Prunes a complete subtree through the owned topology.
The altitude buffer is kept as the canonical dense weighted state; dead slots may retain their old values until a compact export is requested.
Definition at line 361 of file WeightedMorphologicalTree.hpp.
|
inline |
Reconstructs an image by assigning each proper part its owner altitude.
Definition at line 387 of file WeightedMorphologicalTree.hpp.
|
inline |
Updates one live node altitude with local monotonicity validation.
Definition at line 329 of file WeightedMorphologicalTree.hpp.
|
inline |
Replaces the owned altitude buffer after full validation.
Shape and finite-value checks are followed by global monotone validation for max/min component trees.
Definition at line 283 of file WeightedMorphologicalTree.hpp.
|
inline |
Replaces the owned altitude buffer without checking tree-order monotonicity.
This still validates the committed-edit boundary, dense buffer shape, and finite floating-point values. It exists for callers that already maintain the max-tree/min-tree altitude invariant by construction.
Definition at line 300 of file WeightedMorphologicalTree.hpp.
|
inline |
Updates one node altitude without checking tree-order monotonicity.
This still validates the committed-edit boundary, live-node access, and finite floating-point values. Staged topology edits should continue to use WeightedTreeEditor::setNodeAltitude.
Definition at line 346 of file WeightedMorphologicalTree.hpp.
|
inlinenoexcept |
Returns read-only access to the owned topology.
This accessor intentionally does not provide a mutable MorphologicalTree handle. Use edit() for staged topology edits or the safe public mutators for complete local changes.
Definition at line 252 of file WeightedMorphologicalTree.hpp.
|
inline |
Checks that the altitude buffer covers the dense internal-node domain.
Definition at line 241 of file WeightedMorphologicalTree.hpp.
|
inline |
Validates the current altitude buffer against the topology order.
Definition at line 312 of file WeightedMorphologicalTree.hpp.
|
friend |
Definition at line 54 of file WeightedMorphologicalTree.hpp.