mmcfilters
Public API documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
mmcfilters::ValuedMorphologicalTree< T > Class Template Reference

Wrapper pairing MorphologicalTree topology with an external altitude buffer. More...

#include <ValuedMorphologicalTree.hpp>

Public Types

using AltitudeType = T
 Altitude scalar type stored by this valued morphological tree.
 
using NodeAltitudeBuffer = mmcfilters::NodeAltitudeBuffer< T >
 Dense altitude buffer indexed by internal NodeId.
 

Public Member Functions

 ValuedMorphologicalTree (const ValuedMorphologicalTree &)=delete
 Disables copy construction.
 
ValuedMorphologicalTreeoperator= (const ValuedMorphologicalTree &)=delete
 Disables copy assignment.
 
 ValuedMorphologicalTree (ValuedMorphologicalTree &&other)
 Transfers committed topology and altitude ownership.
 
ValuedMorphologicalTreeoperator= (ValuedMorphologicalTree &&other)
 Move-assigns committed topology and altitude ownership.
 
 ValuedMorphologicalTree (detail::MorphologicalTreeConstructionTag, MorphologicalTree &&topology, NodeAltitudeBuffer &&altitude)
 Consumes a producer-owned altitude buffer in the internal node-id domain.
 
void validateNodeAltitudeBufferShape () const
 Checks that the altitude buffer covers the dense internal-node domain.
 
const MorphologicalTreetopology () const noexcept
 Returns read-only access to the owned topology.
 
const NodeAltitudeBuffernodeAltitudes () const noexcept
 Returns the dense altitude buffer indexed by internal NodeId.
 
NodeAltitudeSpan< T > nodeAltitudeSpan () const noexcept
 Returns a read-only span over the dense altitude buffer.
 
ValuedMorphologicalTreeView< T > asView () const
 Creates a non-owning valued-tree view over this owner.
 
void setNodeAltitudes (NodeAltitudeBuffer altitudeBuffer)
 Replaces the owned altitude buffer after full validation.
 
void validateMonotoneNodeAltitudes () const
 Validates the current altitude buffer against the topology order.
 
nodeAltitude (NodeId nodeId) const
 Returns one live node altitude from the dense buffer.
 
void setNodeAltitude (NodeId nodeId, T value)
 Updates one live node altitude with local monotonicity validation.
 
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.
 
AltitudeDifference< T > nodeResidue (NodeId nodeId) const
 Returns the altitude difference between a node and its parent.
 
ImagePtr< T > reconstructFromNodeAltitudes () const
 Reconstructs an image by assigning each proper part its smallest-node altitude.
 
template<class Contribution >
requires (std::is_arithmetic_v<Contribution> && !std::is_same_v<std::remove_cv_t<Contribution>, bool>)
ImagePtr< ContributionreconstructFromNodeContributions (std::span< const Contribution > nodeContributions) const
 Reconstructs from arbitrary dense node contributions using the fixed zero baseline.
 
std::pair< std::vector< NodeId >, std::vector< T > > exportHigraHierarchy () const
 Exports the current live rooted tree to a new compact Higra parent/altitude representation.
 
ValuedMorphologicalTreeEditor< T > edit ()
 Opens the only public entrypoint for staged valued-tree edits.
 

Friends

class ValuedMorphologicalTreeEditor< T >
 

Detailed Description

template<AltitudeValue T>
class mmcfilters::ValuedMorphologicalTree< T >

Wrapper pairing MorphologicalTree topology with an external altitude buffer.

ValuedMorphologicalTree owns the mutable topology and node-altitude state internally, indexed by dense internal NodeId. Read-only topology access and valued-tree convenience methods are exposed without leaking structural mutation. Staged structural edits must go through edit(), which returns a ValuedMorphologicalTreeEditor.

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 43 of file ValuedMorphologicalTree.hpp.

Member Typedef Documentation

◆ AltitudeType

template<AltitudeValue T>
using mmcfilters::ValuedMorphologicalTree< T >::AltitudeType = T

Altitude scalar type stored by this valued morphological tree.

Definition at line 48 of file ValuedMorphologicalTree.hpp.

◆ NodeAltitudeBuffer

template<AltitudeValue T>
using mmcfilters::ValuedMorphologicalTree< T >::NodeAltitudeBuffer = mmcfilters::NodeAltitudeBuffer<T>

Dense altitude buffer indexed by internal NodeId.

Definition at line 51 of file ValuedMorphologicalTree.hpp.

Constructor & Destructor Documentation

◆ ValuedMorphologicalTree() [1/2]

template<AltitudeValue T>
mmcfilters::ValuedMorphologicalTree< T >::ValuedMorphologicalTree ( ValuedMorphologicalTree< T > &&  other)
inline

Transfers committed topology and altitude ownership.

The topology move rejects an active valued-tree editor before any state is transferred.

Parameters
otherObject to compare with or transfer from.

Definition at line 160 of file ValuedMorphologicalTree.hpp.

◆ ValuedMorphologicalTree() [2/2]

template<AltitudeValue T>
mmcfilters::ValuedMorphologicalTree< T >::ValuedMorphologicalTree ( detail::MorphologicalTreeConstructionTag  ,
MorphologicalTree &&  topology,
NodeAltitudeBuffer &&  altitude 
)
inline

Consumes a producer-owned altitude buffer in the internal node-id domain.

Parameters
topologyTree topology.
altitudeAltitude data indexed by node identifier.

Definition at line 188 of file ValuedMorphologicalTree.hpp.

Member Function Documentation

◆ asView()

template<AltitudeValue T>
ValuedMorphologicalTreeView< T > mmcfilters::ValuedMorphologicalTree< T >::asView ( ) const
inline

Creates a non-owning valued-tree view over this owner.

Returns
The created non-owning valued-tree view over this owner.

Definition at line 229 of file ValuedMorphologicalTree.hpp.

◆ edit()

template<AltitudeValue T>
ValuedMorphologicalTreeEditor< T > mmcfilters::ValuedMorphologicalTree< T >::edit ( )
inline

Opens the only public entrypoint for staged valued-tree edits.

Returns
The opened only public entrypoint for staged valued-tree edits.

Definition at line 360 of file ValuedMorphologicalTree.hpp.

◆ exportHigraHierarchy()

template<AltitudeValue T>
std::pair< std::vector< NodeId >, std::vector< T > > mmcfilters::ValuedMorphologicalTree< T >::exportHigraHierarchy ( ) const
inline

Exports the current live rooted tree to a new compact Higra parent/altitude representation.

Attribute buffers are projected through AttributeComputation::projectNodeValuesToExportedHigra() so valued-tree export remains limited to topology and altitudes.

Returns
The exported current live rooted tree to a new compact Higra parent/altitude representation.

Definition at line 351 of file ValuedMorphologicalTree.hpp.

◆ mergeNodeIntoParent()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTree< T >::mergeNodeIntoParent ( NodeId  nodeId)
inline

Merges one node into its parent through the owned topology.

This is the valued-tree counterpart of the safe public topology mutator. Dead slots keep stale altitude values until a compact export is requested.

Parameters
nodeIdDense internal node identifier.

Definition at line 303 of file ValuedMorphologicalTree.hpp.

◆ nodeAltitude()

template<AltitudeValue T>
T mmcfilters::ValuedMorphologicalTree< T >::nodeAltitude ( NodeId  nodeId) const
inline

Returns one live node altitude from the dense buffer.

Parameters
nodeIdDense internal node identifier.
Returns
One live node altitude from the dense buffer.

Definition at line 260 of file ValuedMorphologicalTree.hpp.

◆ nodeAltitudes()

template<AltitudeValue T>
const NodeAltitudeBuffer & mmcfilters::ValuedMorphologicalTree< T >::nodeAltitudes ( ) const
inlinenoexcept

Returns the dense altitude buffer indexed by internal NodeId.

Returns
The dense altitude buffer indexed by internal NodeId.

Definition at line 215 of file ValuedMorphologicalTree.hpp.

◆ nodeAltitudeSpan()

template<AltitudeValue T>
NodeAltitudeSpan< T > mmcfilters::ValuedMorphologicalTree< T >::nodeAltitudeSpan ( ) const
inlinenoexcept

Returns a read-only span over the dense altitude buffer.

Returns
A read-only span over the dense altitude buffer.

Definition at line 222 of file ValuedMorphologicalTree.hpp.

◆ nodeResidue()

template<AltitudeValue T>
AltitudeDifference< T > mmcfilters::ValuedMorphologicalTree< T >::nodeResidue ( NodeId  nodeId) const
inline

Returns the altitude difference between a node and its parent.

The project uses a fixed zero reconstruction baseline, so the root residue is equal to the root altitude.

Parameters
nodeIdDense internal node identifier.
Returns
The altitude difference between a node and its parent.

Definition at line 317 of file ValuedMorphologicalTree.hpp.

◆ operator=()

template<AltitudeValue T>
ValuedMorphologicalTree & mmcfilters::ValuedMorphologicalTree< T >::operator= ( ValuedMorphologicalTree< T > &&  other)
inline

Move-assigns committed topology and altitude ownership.

Both topology owners must be outside edit sessions. This keeps every active ValuedMorphologicalTreeEditor bound to the storage it opened.

Parameters
otherObject to compare with or transfer from.
Returns
Mutable reference to the updated object.

Definition at line 171 of file ValuedMorphologicalTree.hpp.

◆ pruneNode()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTree< T >::pruneNode ( NodeId  nodeId)
inline

Prunes a complete subtree through the owned topology.

The altitude buffer is kept as the canonical dense valued-tree state; dead slots may retain their old values until a compact export is requested.

Parameters
nodeIdDense internal node identifier.

Definition at line 290 of file ValuedMorphologicalTree.hpp.

◆ reconstructFromNodeAltitudes()

template<AltitudeValue T>
ImagePtr< T > mmcfilters::ValuedMorphologicalTree< T >::reconstructFromNodeAltitudes ( ) const
inline

Reconstructs an image by assigning each proper part its smallest-node altitude.

Returns
The reconstructed image by assigning each proper part its smallest-node altitude.

Definition at line 324 of file ValuedMorphologicalTree.hpp.

◆ reconstructFromNodeContributions()

template<AltitudeValue T>
template<class Contribution >
requires (std::is_arithmetic_v<Contribution> && !std::is_same_v<std::remove_cv_t<Contribution>, bool>)
ImagePtr< Contribution > mmcfilters::ValuedMorphologicalTree< T >::reconstructFromNodeContributions ( std::span< const Contribution nodeContributions) const
inline

Reconstructs from arbitrary dense node contributions using the fixed zero baseline.

Template Parameters
ContributionArithmetic contribution and output value type.
Parameters
nodeContributionsDense contribution buffer indexed by the internal node-slot domain.
Returns
Image obtained by accumulating contributions from the root to each smallest node.

Definition at line 336 of file ValuedMorphologicalTree.hpp.

◆ setNodeAltitude()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTree< T >::setNodeAltitude ( NodeId  nodeId,
value 
)
inline

Updates one live node altitude with local monotonicity validation.

Parameters
nodeIdDense internal node identifier.
valueValue.

Definition at line 272 of file ValuedMorphologicalTree.hpp.

◆ setNodeAltitudes()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTree< T >::setNodeAltitudes ( NodeAltitudeBuffer  altitudeBuffer)
inline

Replaces the owned altitude buffer after full validation.

Shape and finite-value checks are followed by validation of the hierarchy's declared global altitude order.

Parameters
altitudeBufferAltitude or level.

Definition at line 239 of file ValuedMorphologicalTree.hpp.

◆ topology()

template<AltitudeValue T>
const MorphologicalTree & mmcfilters::ValuedMorphologicalTree< T >::topology ( ) const
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.

Returns
Read-only access to the owned topology.

Definition at line 208 of file ValuedMorphologicalTree.hpp.

◆ validateMonotoneNodeAltitudes()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTree< T >::validateMonotoneNodeAltitudes ( ) const
inline

Validates the current altitude buffer against the topology order.

Definition at line 252 of file ValuedMorphologicalTree.hpp.

◆ validateNodeAltitudeBufferShape()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTree< T >::validateNodeAltitudeBufferShape ( ) const
inline

Checks that the altitude buffer covers the dense internal-node domain.

Definition at line 197 of file ValuedMorphologicalTree.hpp.

Friends And Related Symbol Documentation

◆ ValuedMorphologicalTreeEditor< T >

template<AltitudeValue T>
friend class ValuedMorphologicalTreeEditor< T >
friend

Definition at line 26 of file ValuedMorphologicalTree.hpp.


The documentation for this class was generated from the following file: