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

Incremental bounding-box scalar attribute. More...

#include <DynamicTreeAttributeComputer.hpp>

Inheritance diagram for mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >:
Inheritance graph
[legend]
Collaboration diagram for mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >:
Collaboration graph
[legend]

Public Types

using buffer_type = typename base_t::buffer_type
 Dense per-node bounding-box attribute buffer inherited from the dynamic protocol.
 
- Public Types inherited from mmcfilters::adjust::DynamicTreeAttributeComputer< T >
using buffer_type = std::vector< double >
 Dense per-node attribute buffer used by dynamic adjustment computers.
 

Public Member Functions

 DynamicBoundingBoxAttributeComputer (BoundingBoxMeasure measure=BoundingBoxMeasure::DIAGONAL_LENGTH)
 Creates a bounding-box computer returning the requested scalar measure.
 
void resize (const WeightedMorphologicalTree< T > &tree, buffer_type &buffer) const override
 Resizes public and auxiliary buffers to the current tree slot space.
 
void preProcessing (NodeId nodeId, const WeightedMorphologicalTree< T > &tree, buffer_type &) const override
 Initializes the subtree box of one node from its direct proper parts.
 
void mergeProcessing (NodeId parentId, NodeId childId, const WeightedMorphologicalTree< T > &, buffer_type &) const override
 Accumulates a child subtree box into its parent subtree box.
 
void postProcessing (NodeId nodeId, const WeightedMorphologicalTree< T > &, buffer_type &buffer) const override
 Converts the accumulated subtree box into the configured scalar measure.
 
void onMoveProperParts (NodeId targetId, NodeId sourceId, const WeightedMorphologicalTree< T > &tree) const override
 Updates local boxes after all proper parts move from sourceId to targetId.
 
void onMoveProperPart (NodeId targetId, NodeId sourceId, NodeId pixelId, const WeightedMorphologicalTree< T > &tree) const override
 Updates local boxes after one proper part moves between nodes.
 
void onNodeRemoved (NodeId nodeId, const WeightedMorphologicalTree< T > &) const override
 Clears auxiliary summaries associated with a released node slot.
 
- Public Member Functions inherited from mmcfilters::adjust::DynamicTreeAttributeComputer< T >
virtual ~DynamicTreeAttributeComputer ()=default
 Destroys a dynamic attribute computer through the protocol base.
 
void computeAttribute (const WeightedMorphologicalTree< T > &tree, buffer_type &buffer) const
 Computes the attribute for the full current tree in post-order.
 
void computeAttributeOnNode (const WeightedMorphologicalTree< T > &tree, NodeId nodeId, buffer_type &buffer) const
 Recomputes one node assuming all direct children are already up to date.
 

Detailed Description

template<AltitudeValue T>
class mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >

Incremental bounding-box scalar attribute.

The computer keeps two levels of cached state:

Single proper-part moves update the receiver eagerly. The donor is kept exact unless the moved pixel exhausts one extremum, in which case its local summary is marked dirty and rebuilt lazily on the next access. This preserves the local-update structure of the Higra version while adapting coordinates to this project's row-major image domain.

Definition at line 231 of file DynamicTreeAttributeComputer.hpp.

Member Typedef Documentation

◆ buffer_type

Dense per-node bounding-box attribute buffer inherited from the dynamic protocol.

Definition at line 237 of file DynamicTreeAttributeComputer.hpp.

Constructor & Destructor Documentation

◆ DynamicBoundingBoxAttributeComputer()

template<AltitudeValue T>
mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::DynamicBoundingBoxAttributeComputer ( BoundingBoxMeasure  measure = BoundingBoxMeasure::DIAGONAL_LENGTH)
inlineexplicit

Creates a bounding-box computer returning the requested scalar measure.

Parameters
measureScalar projection materialized from the accumulated bounding-box state.

Definition at line 473 of file DynamicTreeAttributeComputer.hpp.

Member Function Documentation

◆ mergeProcessing()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::mergeProcessing ( NodeId  parentId,
NodeId  childId,
const WeightedMorphologicalTree< T > &  ,
buffer_type  
) const
inlineoverridevirtual

Accumulates a child subtree box into its parent subtree box.

Implements mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 500 of file DynamicTreeAttributeComputer.hpp.

◆ onMoveProperPart()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::onMoveProperPart ( NodeId  targetId,
NodeId  sourceId,
NodeId  pixelId,
const WeightedMorphologicalTree< T > &  tree 
) const
inlineoverridevirtual

Updates local boxes after one proper part moves between nodes.

The target box is enlarged eagerly. The source box remains exact unless the removed pixel exhausts one extremum; in that case the source summary is marked dirty and rebuilt lazily.

Reimplemented from mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 545 of file DynamicTreeAttributeComputer.hpp.

◆ onMoveProperParts()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::onMoveProperParts ( NodeId  targetId,
NodeId  sourceId,
const WeightedMorphologicalTree< T > &  tree 
) const
inlineoverridevirtual

Updates local boxes after all proper parts move from sourceId to targetId.

Reimplemented from mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 532 of file DynamicTreeAttributeComputer.hpp.

◆ onNodeRemoved()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::onNodeRemoved ( NodeId  nodeId,
const WeightedMorphologicalTree< T > &   
) const
inlineoverridevirtual

Clears auxiliary summaries associated with a released node slot.

Reimplemented from mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 611 of file DynamicTreeAttributeComputer.hpp.

◆ postProcessing()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::postProcessing ( NodeId  nodeId,
const WeightedMorphologicalTree< T > &  ,
buffer_type buffer 
) const
inlineoverridevirtual

Converts the accumulated subtree box into the configured scalar measure.

Implements mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 507 of file DynamicTreeAttributeComputer.hpp.

◆ preProcessing()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::preProcessing ( NodeId  nodeId,
const WeightedMorphologicalTree< T > &  tree,
buffer_type  
) const
inlineoverridevirtual

Initializes the subtree box of one node from its direct proper parts.

Implements mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 492 of file DynamicTreeAttributeComputer.hpp.

◆ resize()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::resize ( const WeightedMorphologicalTree< T > &  tree,
buffer_type buffer 
) const
inlineoverridevirtual

Resizes public and auxiliary buffers to the current tree slot space.

Auxiliary direct/local and subtree summaries are indexed by the same dense internal node-id space as the public output buffer.

Reimplemented from mmcfilters::adjust::DynamicTreeAttributeComputer< T >.

Definition at line 482 of file DynamicTreeAttributeComputer.hpp.


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