mmcfilters
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::DiagonalLength)
 Creates a bounding-box computer returning the requested scalar measure.
 
void resize (const ValuedMorphologicalTree< T > &tree, buffer_type &buffer) const override
 Resizes public and auxiliary buffers to the current tree slot space.
 
void preProcessing (NodeId nodeId, const ValuedMorphologicalTree< T > &tree, buffer_type &) const override
 Initializes one node's subtree bounding box from its proper part.
 
void mergeProcessing (NodeId parentId, NodeId childId, const ValuedMorphologicalTree< T > &, buffer_type &) const override
 Accumulates a child subtree box into its parent subtree box.
 
void postProcessing (NodeId nodeId, const ValuedMorphologicalTree< T > &, buffer_type &buffer) const override
 Converts the accumulated subtree box into the configured scalar measure.
 
void onMoveProperParts (NodeId targetId, NodeId sourceId, const ValuedMorphologicalTree< T > &tree) const override
 Updates local boxes after all proper parts move from sourceId to targetId.
 
void onMoveProperPart (NodeId targetId, NodeId sourceId, PixelId pixelId, const ValuedMorphologicalTree< T > &tree) const override
 Updates local boxes after one proper part moves between nodes.
 
void onNodeRemoved (NodeId nodeId, const ValuedMorphologicalTree< 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 ValuedMorphologicalTree< T > &tree, buffer_type &buffer) const
 Computes the attribute for the full current tree in post-order.
 
void computeAttributeOnNode (const ValuedMorphologicalTree< 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 238 of file DynamicTreeAttributeComputer.hpp.

Member Typedef Documentation

◆ buffer_type

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

Definition at line 245 of file DynamicTreeAttributeComputer.hpp.

Constructor & Destructor Documentation

◆ DynamicBoundingBoxAttributeComputer()

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

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

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

Definition at line 524 of file DynamicTreeAttributeComputer.hpp.

Member Function Documentation

◆ mergeProcessing()

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

Accumulates a child subtree box into its parent subtree box.

Parameters
parentIdIdentifier of the parent node.
childIdIdentifier of the child node.

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

Definition at line 559 of file DynamicTreeAttributeComputer.hpp.

◆ onMoveProperPart()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::onMoveProperPart ( NodeId  targetId,
NodeId  sourceId,
PixelId  pixelId,
const ValuedMorphologicalTree< 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.

Parameters
targetIdDestination.
sourceIdInput.
pixelIdPixel identifier.
treeTree topology.

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

Definition at line 616 of file DynamicTreeAttributeComputer.hpp.

◆ onMoveProperParts()

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

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

Parameters
targetIdDestination.
sourceIdInput.
treeTree topology.

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

Definition at line 598 of file DynamicTreeAttributeComputer.hpp.

◆ onNodeRemoved()

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

Clears auxiliary summaries associated with a released node slot.

Parameters
nodeIdDense internal node identifier.

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

Definition at line 684 of file DynamicTreeAttributeComputer.hpp.

◆ postProcessing()

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

Converts the accumulated subtree box into the configured scalar measure.

Parameters
nodeIdDense internal node identifier.
bufferBuffer read or written by the operation.

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

Definition at line 569 of file DynamicTreeAttributeComputer.hpp.

◆ preProcessing()

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

Initializes one node's subtree bounding box from its proper part.

Parameters
nodeIdDense internal node identifier.
treeTree topology.

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

Definition at line 548 of file DynamicTreeAttributeComputer.hpp.

◆ resize()

template<AltitudeValue T>
void mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >::resize ( const ValuedMorphologicalTree< 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.

Parameters
treeTree topology.
bufferBuffer read or written by the operation.

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

Definition at line 535 of file DynamicTreeAttributeComputer.hpp.


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