|
MorphologicalAttributeFilters
Public API documentation
|
Common protocol for attributes maintained during local tree adjustment. More...
#include <DynamicTreeAttributeComputer.hpp>

Public Types | |
| using | buffer_type = std::vector< double > |
| Dense per-node attribute buffer used by dynamic adjustment computers. | |
Public Member Functions | |
| virtual | ~DynamicTreeAttributeComputer ()=default |
| Destroys a dynamic attribute computer through the protocol base. | |
| virtual void | resize (const WeightedMorphologicalTree< T > &tree, buffer_type &buffer) const |
| Resizes an attribute buffer to the full internal node-id space. | |
| virtual void | preProcessing (NodeId nodeId, const WeightedMorphologicalTree< T > &tree, buffer_type &buffer) const =0 |
| Initializes the direct contribution of one node before child merges. | |
| virtual void | mergeProcessing (NodeId parentId, NodeId childId, const WeightedMorphologicalTree< T > &tree, buffer_type &buffer) const =0 |
| Accumulates an already-current child contribution into its parent. | |
| virtual void | postProcessing (NodeId nodeId, const WeightedMorphologicalTree< T > &tree, buffer_type &buffer) const =0 |
| Materializes the final scalar value for one node after all child merges. | |
| virtual void | onMoveProperParts (NodeId, NodeId, const WeightedMorphologicalTree< T > &) const |
| Incremental hook called after all direct proper parts move from one node to another. | |
| virtual void | onMoveProperPart (NodeId, NodeId, NodeId, const WeightedMorphologicalTree< T > &) const |
| Incremental hook called after one proper part moves between nodes. | |
| virtual void | onNodeRemoved (NodeId, const WeightedMorphologicalTree< T > &) const |
| Incremental hook called when one node slot is released from the live tree. | |
| 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. | |
Common protocol for attributes maintained during local tree adjustment.
The dual min/max-tree adjuster performs structural edits that are local to the affected component. Recomputing every node attribute after each edit would change the practical cost profile of the connected alternating sequential filter, so attributes used by the CASF follow the same incremental contract as the Higra implementation:
preProcessing initializes the direct contribution of one node;mergeProcessing accumulates an already-current child contribution into its parent;postProcessing materializes the final scalar value;Buffers are indexed in this project's dense internal NodeId space, not in Higra's global leaf+node id space. This is the main representation difference relative to the source algorithm and keeps the implementation compatible with WeightedMorphologicalTree<T>.
Definition at line 50 of file DynamicTreeAttributeComputer.hpp.
| using mmcfilters::adjust::DynamicTreeAttributeComputer< T >::buffer_type = std::vector<double> |
Dense per-node attribute buffer used by dynamic adjustment computers.
Definition at line 53 of file DynamicTreeAttributeComputer.hpp.
|
inline |
Computes the attribute for the full current tree in post-order.
This is used to bootstrap the buffers before the first adjustment step and as a reference-compatible full computation. Adjustment steps later refresh only the nodes marked by local structural changes.
| tree | Current mutable weighted tree state. |
| buffer | Dense output buffer. It is resized before computation. |
Definition at line 145 of file DynamicTreeAttributeComputer.hpp.
|
inline |
Recomputes one node assuming all direct children are already up to date.
| tree | Current mutable weighted tree state. |
| nodeId | Live dense internal node id to refresh. |
| buffer | Dense output buffer already sized for the tree. |
Definition at line 164 of file DynamicTreeAttributeComputer.hpp.
|
pure virtual |
Accumulates an already-current child contribution into its parent.
| parentId | Live dense internal parent node id. |
| childId | Live dense internal child node id whose buffer entry is already current. |
| tree | Current mutable weighted tree state. |
| buffer | Dense per-node output buffer. |
Implemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >, and mmcfilters::adjust::DynamicAreaAttributeComputer< T >.
|
inlinevirtual |
Incremental hook called after one proper part moves between nodes.
Default implementation is a no-op so concrete computers override only the structural events they need.
The parameters are proper-part id, source node id, destination node id, and current tree state.
Reimplemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >.
Definition at line 123 of file DynamicTreeAttributeComputer.hpp.
|
inlinevirtual |
Incremental hook called after all direct proper parts move from one node to another.
Default implementation is a no-op so concrete computers override only the structural events they need.
The parameters are source node id, destination node id, and current tree state. Implementations that maintain direct-proper-part caches can use this event to move or invalidate cached summaries without a full rebuild.
Reimplemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >.
Definition at line 113 of file DynamicTreeAttributeComputer.hpp.
|
inlinevirtual |
Incremental hook called when one node slot is released from the live tree.
Default implementation is a no-op so concrete computers override only the structural events they need.
Implementations should clear or invalidate any auxiliary state indexed by the released dense internal node id.
Reimplemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >.
Definition at line 133 of file DynamicTreeAttributeComputer.hpp.
|
pure virtual |
Materializes the final scalar value for one node after all child merges.
| nodeId | Live dense internal node id being finalized. |
| tree | Current mutable weighted tree state. |
| buffer | Dense per-node output buffer. |
Implemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >, and mmcfilters::adjust::DynamicAreaAttributeComputer< T >.
|
pure virtual |
Initializes the direct contribution of one node before child merges.
| nodeId | Live dense internal node id being recomputed. |
| tree | Current mutable weighted tree state. |
| buffer | Dense per-node output buffer. |
Implemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >, and mmcfilters::adjust::DynamicAreaAttributeComputer< T >.
|
inlinevirtual |
Resizes an attribute buffer to the full internal node-id space.
Released slots remain addressable while the dynamic adjustment is running, so buffers are sized by the number of allocated internal node slots rather than by the number of currently alive nodes.
| tree | Weighted tree whose internal node-slot domain defines the buffer size. |
| buffer | Output buffer resized to the full internal node-slot count. |
Reimplemented in mmcfilters::adjust::DynamicBoundingBoxAttributeComputer< T >.
Definition at line 71 of file DynamicTreeAttributeComputer.hpp.