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

Connected alternating sequential filter on paired component trees. More...

#include <CasfComponentTrees.hpp>

Public Member Functions

 CasfComponentTrees (image_ptr_t image, CasfComponentTreesAttribute attribute=CasfComponentTreesAttribute::AREA, double radius=1.5)
 Initializes the CASF state from the input image and the chosen attribute.
 
image_ptr_t filter (const std::vector< double > &thresholds)
 Runs the CASF on the threshold sequence and returns the filtered image.
 
const tree_tminTree () const noexcept
 Returns the current min-tree state.
 
const tree_tmaxTree () const noexcept
 Returns the current max-tree state.
 
CasfComponentTreesAttribute attribute () const noexcept
 Returns the increasing attribute configured for this CASF instance.
 
std::pair< std::vector< NodeId >, std::vector< T > > exportMinTree () const
 Exports the current min-tree as a compact static parent/altitude pair.
 
std::pair< std::vector< NodeId >, std::vector< T > > exportMaxTree () const
 Exports the current max-tree as a compact static parent/altitude pair.
 

Detailed Description

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

Connected alternating sequential filter on paired component trees.

This class implements a connected alternating sequential filter (CASF) on a fixed image-domain adjacency. Instead of rebuilding both component trees after every threshold, it owns a mutable min-tree / max-tree pair and updates one tree incrementally whenever rooted subtrees are pruned from the dual one.

Supported workflow:

For each threshold, the standard two CASF half-steps are performed:

Internal state owned by this class:

Update semantics:

Attribute buffers are initialized once and then kept synchronized through DualMinMaxTreeIncrementalFilter; they are not globally recomputed at every threshold.

Ownership note:

CASF intentionally remains a mutable WeightedMorphologicalTree<T> owner. WeightedTreeView<T> is suited to read-only kernels; here each threshold step changes tree topology, proper-part ownership, altitude state, and dynamic attribute buffers together.

Definition at line 84 of file CasfComponentTrees.hpp.

Constructor & Destructor Documentation

◆ CasfComponentTrees()

template<AltitudeValue T>
mmcfilters::adjust::CasfComponentTrees< T >::CasfComponentTrees ( image_ptr_t  image,
CasfComponentTreesAttribute  attribute = CasfComponentTreesAttribute::AREA,
double  radius = 1.5 
)
inline

Initializes the CASF state from the input image and the chosen attribute.

Parameters
imageInput gray-level image.
attributeIncreasing attribute used to select pruning candidates.
radiusRadius used to build the image-domain adjacency relation.

Definition at line 188 of file CasfComponentTrees.hpp.

Member Function Documentation

◆ attribute()

template<AltitudeValue T>
CasfComponentTreesAttribute mmcfilters::adjust::CasfComponentTrees< T >::attribute ( ) const
inlinenoexcept

Returns the increasing attribute configured for this CASF instance.

Definition at line 241 of file CasfComponentTrees.hpp.

◆ exportMaxTree()

template<AltitudeValue T>
std::pair< std::vector< NodeId >, std::vector< T > > mmcfilters::adjust::CasfComponentTrees< T >::exportMaxTree ( ) const
inline

Exports the current max-tree as a compact static parent/altitude pair.

The pair follows the local WeightedMorphologicalTree<T> export convention and can be compared with Higra-style static hierarchy outputs in tests and benchmarks.

Definition at line 261 of file CasfComponentTrees.hpp.

◆ exportMinTree()

template<AltitudeValue T>
std::pair< std::vector< NodeId >, std::vector< T > > mmcfilters::adjust::CasfComponentTrees< T >::exportMinTree ( ) const
inline

Exports the current min-tree as a compact static parent/altitude pair.

The pair follows the local WeightedMorphologicalTree<T> export convention and can be compared with Higra-style static hierarchy outputs in tests and benchmarks.

Definition at line 251 of file CasfComponentTrees.hpp.

◆ filter()

template<AltitudeValue T>
image_ptr_t mmcfilters::adjust::CasfComponentTrees< T >::filter ( const std::vector< double > &  thresholds)
inline

Runs the CASF on the threshold sequence and returns the filtered image.

Thresholds are applied to the current internal state. The object is therefore stateful: successive non-empty calls continue filtering the result of the previous ones.

Definition at line 217 of file CasfComponentTrees.hpp.

◆ maxTree()

template<AltitudeValue T>
const tree_t & mmcfilters::adjust::CasfComponentTrees< T >::maxTree ( ) const
inlinenoexcept

Returns the current max-tree state.

Definition at line 234 of file CasfComponentTrees.hpp.

◆ minTree()

template<AltitudeValue T>
const tree_t & mmcfilters::adjust::CasfComponentTrees< T >::minTree ( ) const
inlinenoexcept

Returns the current min-tree state.

Definition at line 227 of file CasfComponentTrees.hpp.


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