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

Family of attribute-based image filtering operators on morphological trees. More...

#include <AttributeFilters.hpp>

Public Member Functions

 AttributeFilters (AltitudeView view)
 Creates filtering operators over a non-owning valued tree view.
 
 AttributeFilters (const ValuedMorphologicalTree< T > &valuedTree)
 Creates filtering operators over an owned valued tree.
 
 ~AttributeFilters ()=default
 Destroys the attribute-filter facade.
 
template<std::floating_point Real>
ImagePtr< T > filteringByPruningMin (const std::shared_ptr< Real[]> &attr, Real threshold)
 Applies pruning-min filtering from an attribute buffer.
 
template<std::floating_point Real>
ImagePtr< T > filteringByPruningMin (const Real *attr, Real threshold)
 Applies pruning-min filtering from a raw internal-node attribute buffer.
 
template<std::floating_point Real>
ImagePtr< T > filteringByPruningMax (const std::shared_ptr< Real[]> &attr, Real threshold)
 Applies pruning-max filtering from an attribute buffer.
 
template<std::floating_point Real>
ImagePtr< T > filteringByPruningMax (const Real *attr, Real threshold)
 Applies pruning-max filtering from a raw internal-node attribute buffer.
 
template<std::floating_point Real>
ImagePtr< T > filteringByViterbiRule (const Real *attr, Real threshold)
 Applies Salembier-style Viterbi filtering from a raw attribute buffer.
 
ImagePtr< T > filteringByPruningMin (const NodePreservationMask &nodePreservationMask)
 Applies pruning-min filtering from a dense node-preservation mask.
 
ImagePtr< T > filteringByPruningMax (const NodePreservationMask &nodePreservationMask)
 Applies pruning-max filtering from a dense node-preservation mask.
 

Static Public Member Functions

static void filteringByPruningMin (const ValuedMorphologicalTreeView< T > &valuedTree, const NodePreservationMask &nodePreservationMask, ImagePtr< T > imgOutputPtr)
 Writes pruning-min filtering from a node-preservation mask into an output image.
 
static void filteringByPruningMin (const ValuedMorphologicalTree< T > &valuedTree, const NodePreservationMask &nodePreservationMask, ImagePtr< T > imgOutputPtr)
 Writes pruning-min filtering from a valued-tree owner into an output image.
 
static void filteringByPruningMax (const ValuedMorphologicalTreeView< T > &valuedTree, const NodePreservationMask &nodePreservationMask, ImagePtr< T > imgOutputPtr)
 Writes pruning-max filtering from a node-preservation mask into an output image.
 
static void filteringByPruningMax (const ValuedMorphologicalTree< T > &valuedTree, const NodePreservationMask &nodePreservationMask, ImagePtr< T > imgOutputPtr)
 Writes pruning-max filtering from a valued-tree owner into an output image.
 
template<std::floating_point Real>
static void filteringByPruningMin (const ValuedMorphologicalTreeView< T > &valuedTree, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-min filtering from an owned attribute buffer into an output image.
 
template<std::floating_point Real>
static void filteringByPruningMin (const ValuedMorphologicalTree< T > &valuedTree, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-min filtering from a valued-tree owner and owned attribute buffer.
 
template<std::floating_point Real>
static void filteringByPruningMin (const ValuedMorphologicalTreeView< T > &valuedTree, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-min filtering from a raw attribute buffer into an output image.
 
template<std::floating_point Real>
static void filteringByPruningMin (const ValuedMorphologicalTree< T > &valuedTree, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-min filtering from a valued-tree owner and raw attribute buffer.
 
template<std::floating_point Real>
static void filteringByPruningMax (const ValuedMorphologicalTreeView< T > &valuedTree, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-max filtering from an owned attribute buffer into an output image.
 
template<std::floating_point Real>
static void filteringByPruningMax (const ValuedMorphologicalTree< T > &valuedTree, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-max filtering from a valued-tree owner and owned attribute buffer.
 
template<std::floating_point Real>
static void filteringByPruningMax (const ValuedMorphologicalTreeView< T > &valuedTree, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-max filtering from a raw attribute buffer into an output image.
 
template<std::floating_point Real>
static void filteringByPruningMax (const ValuedMorphologicalTree< T > &valuedTree, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr)
 Writes pruning-max filtering from a valued-tree owner and raw attribute buffer.
 

Detailed Description

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

Family of attribute-based image filtering operators on morphological trees.

AttributeFilters groups pruning, Viterbi, and extinction-related operations. Direct and subtractive reconstruction are exposed separately by DirectAttributeFilter, SubtractiveAttributeFilter, and SoftSubtractiveAttributeFilter. The operators consume preservation masks or attribute buffers defined on dense node ids and reconstruct pixel images.

Contract and node-domain assumptions:

Reconstruction rule summary:

Pruning-min accepts a node when its attribute is greater than the threshold; pruning-max marks a node as rejected when its attribute is less than or equal to the threshold. Both rules always visit the root. Each visited node writes its own altitude to its proper part; a collapsed subtree receives the altitude selected by the rule above. Returned images own their storage and have the tree's grid dimensions. Overloads taking an output image require those same dimensions and write into the supplied storage.

Definition at line 70 of file AttributeFilters.hpp.

Constructor & Destructor Documentation

◆ AttributeFilters() [1/2]

template<AltitudeValue T>
mmcfilters::AttributeFilters< T >::AttributeFilters ( AltitudeView  view)
inlineexplicit

Creates filtering operators over a non-owning valued tree view.

The view must remain valid for the lifetime of the filter object. Public methods reject use after the underlying topology mutates.

Parameters
viewTree view.

Definition at line 372 of file AttributeFilters.hpp.

◆ AttributeFilters() [2/2]

template<AltitudeValue T>
mmcfilters::AttributeFilters< T >::AttributeFilters ( const ValuedMorphologicalTree< T > &  valuedTree)
inlineexplicit

Creates filtering operators over an owned valued tree.

This overload keeps a pointer to the owner so methods that require tree-owned altitude state, such as MSER-assisted preservation selection, can be used.

Parameters
valuedTreeValued tree.

Definition at line 385 of file AttributeFilters.hpp.

Member Function Documentation

◆ filteringByPruningMax() [1/9]

template<AltitudeValue T>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const NodePreservationMask nodePreservationMask)
inline

Applies pruning-max filtering from a dense node-preservation mask.

Parameters
nodePreservationMaskDecisions indexed by internal NodeId, with exactly numInternalNodeSlots() entries; true accepts a node.
Returns
Independently allocated image with the tree's grid dimensions.

Definition at line 492 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [2/9]

template<AltitudeValue T>
template<std::floating_point Real>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const Real *  attr,
Real  threshold 
)
inline

Applies pruning-max filtering from a raw internal-node attribute buffer.

Parameters
attrNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
Returns
Independently allocated image with the tree's grid dimensions.

Definition at line 445 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [3/9]

template<AltitudeValue T>
template<std::floating_point Real>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const std::shared_ptr< Real[]> &  attr,
Real  threshold 
)
inline

Applies pruning-max filtering from an attribute buffer.

Nodes with attribute values above threshold are kept, and fully rejected subtrees are reconstructed at their own subtree levels.

Parameters
attrNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
Returns
Independently allocated image with the tree's grid dimensions.

Definition at line 433 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [4/9]

template<AltitudeValue T>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const ValuedMorphologicalTree< T > &  valuedTree,
const NodePreservationMask nodePreservationMask,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-max filtering from a valued-tree owner into an output image.

Parameters
valuedTreeValued tree.
nodePreservationMaskDecisions indexed by internal NodeId, with exactly numInternalNodeSlots() entries; true accepts a node.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 545 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [5/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const ValuedMorphologicalTree< T > &  valuedTree,
const Real *  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-max filtering from a valued-tree owner and raw attribute buffer.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 660 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [6/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const ValuedMorphologicalTree< T > &  valuedTree,
const std::shared_ptr< Real[]> &  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-max filtering from a valued-tree owner and owned attribute buffer.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 631 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [7/9]

template<AltitudeValue T>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const ValuedMorphologicalTreeView< T > &  valuedTree,
const NodePreservationMask nodePreservationMask,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-max filtering from a node-preservation mask into an output image.

Parameters
valuedTreeValued tree.
nodePreservationMaskDecisions indexed by internal NodeId, with exactly numInternalNodeSlots() entries; true accepts a node.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 532 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [8/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const ValuedMorphologicalTreeView< T > &  valuedTree,
const Real *  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-max filtering from a raw attribute buffer into an output image.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 646 of file AttributeFilters.hpp.

◆ filteringByPruningMax() [9/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMax ( const ValuedMorphologicalTreeView< T > &  valuedTree,
const std::shared_ptr< Real[]> &  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-max filtering from an owned attribute buffer into an output image.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 617 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [1/9]

template<AltitudeValue T>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const NodePreservationMask nodePreservationMask)
inline

Applies pruning-min filtering from a dense node-preservation mask.

Parameters
nodePreservationMaskDecisions indexed by internal NodeId, with exactly numInternalNodeSlots() entries; true accepts a node.
Returns
Independently allocated image with the tree's grid dimensions.

Definition at line 479 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [2/9]

template<AltitudeValue T>
template<std::floating_point Real>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const Real *  attr,
Real  threshold 
)
inline

Applies pruning-min filtering from a raw internal-node attribute buffer.

Parameters
attrNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
Returns
Independently allocated image with the tree's grid dimensions.

Definition at line 416 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [3/9]

template<AltitudeValue T>
template<std::floating_point Real>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const std::shared_ptr< Real[]> &  attr,
Real  threshold 
)
inline

Applies pruning-min filtering from an attribute buffer.

Nodes with attribute values above threshold remain traversable; rejected subtrees are reconstructed at the ancestor level selected by the pruning-min rule.

Parameters
attrNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
Returns
Independently allocated image with the tree's grid dimensions.

Definition at line 404 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [4/9]

template<AltitudeValue T>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const ValuedMorphologicalTree< T > &  valuedTree,
const NodePreservationMask nodePreservationMask,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-min filtering from a valued-tree owner into an output image.

Parameters
valuedTreeValued tree.
nodePreservationMaskDecisions indexed by internal NodeId, with exactly numInternalNodeSlots() entries; true accepts a node.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 519 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [5/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const ValuedMorphologicalTree< T > &  valuedTree,
const Real *  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-min filtering from a valued-tree owner and raw attribute buffer.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 603 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [6/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const ValuedMorphologicalTree< T > &  valuedTree,
const std::shared_ptr< Real[]> &  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-min filtering from a valued-tree owner and owned attribute buffer.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 574 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [7/9]

template<AltitudeValue T>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const ValuedMorphologicalTreeView< T > &  valuedTree,
const NodePreservationMask nodePreservationMask,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-min filtering from a node-preservation mask into an output image.

Parameters
valuedTreeValued tree.
nodePreservationMaskDecisions indexed by internal NodeId, with exactly numInternalNodeSlots() entries; true accepts a node.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 506 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [8/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const ValuedMorphologicalTreeView< T > &  valuedTree,
const Real *  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-min filtering from a raw attribute buffer into an output image.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 589 of file AttributeFilters.hpp.

◆ filteringByPruningMin() [9/9]

template<AltitudeValue T>
template<std::floating_point Real>
static void mmcfilters::AttributeFilters< T >::filteringByPruningMin ( const ValuedMorphologicalTreeView< T > &  valuedTree,
const std::shared_ptr< Real[]> &  attribute,
Real  threshold,
ImagePtr< T >  imgOutputPtr 
)
inlinestatic

Writes pruning-min filtering from an owned attribute buffer into an output image.

Parameters
valuedTreeValued tree.
attributeNon-null attribute buffer indexed by internal NodeId, with at least numInternalNodeSlots() readable entries.
thresholdPruning cutoff; values equal to it are rejected.
imgOutputPtrNon-null output image with the tree's grid dimensions.

Definition at line 560 of file AttributeFilters.hpp.

◆ filteringByViterbiRule()

template<AltitudeValue T>
template<std::floating_point Real>
ImagePtr< T > mmcfilters::AttributeFilters< T >::filteringByViterbiRule ( const Real *  attr,
Real  threshold 
)
inline

Applies Salembier-style Viterbi filtering from a raw attribute buffer.

The internal detail implementation turns attr and threshold into preserve/remove costs and solves the optimal connected keep mask on the tree. The root is always preserved. Once the Viterbi path removes a node, every descendant is removed as well; preserved descendants can only appear below preserved ancestors. The final image is reconstructed by the direct rule using that connected node-preservation mask.

Parameters
attrAttribute requested by the operation.
thresholdThreshold applied by the operation.
Returns
Image produced by the operation.

Definition at line 465 of file AttributeFilters.hpp.


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