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

Computes and stores extinction values for regional extrema. More...

#include <ExtinctionValues.hpp>

Public Member Functions

 ExtinctionValues (const AltitudeView &view, const std::shared_ptr< Real[]> &attr)
 Computes extinction values from a weighted view and shared attribute buffer.
 
 ExtinctionValues (const AltitudeView &view, const std::vector< Real > &attr)
 Computes extinction values from a weighted view and vector attribute buffer.
 
 ExtinctionValues (const AltitudeView &view, const Real *attr)
 Computes extinction values from a weighted view and raw attribute buffer.
 
 ExtinctionValues (const WeightedMorphologicalTree< T > &weighted, const std::shared_ptr< Real[]> &attr)
 Computes extinction values from a weighted tree and shared attribute buffer.
 
 ExtinctionValues (const WeightedMorphologicalTree< T > &weighted, const std::vector< Real > &attr)
 Computes extinction values from a weighted tree and vector attribute buffer.
 
 ExtinctionValues (const WeightedMorphologicalTree< T > &weighted, const Real *attr)
 Computes extinction values from a weighted tree and raw attribute buffer.
 
ImagePtr< RealsaliencyMap (int extremaToKeep, bool unweighted=true)
 Builds a contour saliency image from the strongest extrema.
 
ImagePtr< Tfiltering (int extremaToKeep)
 Reconstructs an image by keeping the strongest extrema.
 
std::vector< RegionalExtremaNode< Real > > & getExtinctionValues ()
 Returns the extinction records sorted by decreasing extinction.
 

Detailed Description

template<AltitudeValue T, std::floating_point Real = float>
class mmcfilters::ExtinctionValues< T, Real >

Computes and stores extinction values for regional extrema.

ExtinctionValues implements the classical leaf-extrema extinction ranking for max-trees and min-trees. In this component-tree setting, the regional extrema processed by the algorithm are the tree leaves. The supplied scalar attribute is indexed by dense internal NodeId, must have one value for every internal node slot, and is interpreted so that larger values represent stronger extrema. Results are sorted in decreasing extinction order and can be consumed either as records, a filtered reconstruction, or a contour saliency map.

The strongest extremum has no stronger merge point. Its extinction value is represented by the explicit finite sentinel numeric_limits<Real>::max().

Trees of shapes and self-dual residual trees are intentionally rejected by the public constructors because their complete regional-extrema set is not generally equivalent to tree.getLeaves().

The object records the tree mutation version at construction time. Public operations reject use after the underlying topology changes.

Template Parameters
TAltitude type used by the weighted tree or weighted view.
RealAttribute-buffer floating-point type.

Definition at line 75 of file ExtinctionValues.hpp.

Constructor & Destructor Documentation

◆ ExtinctionValues() [1/6]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::ExtinctionValues< T, Real >::ExtinctionValues ( const AltitudeView view,
const std::shared_ptr< Real[]> &  attr 
)
inline

Computes extinction values from a weighted view and shared attribute buffer.

Parameters
viewWeighted tree view whose topology and altitude define the reconstruction domain.
attrShared buffer with one scalar attribute value per internal node slot.

Definition at line 180 of file ExtinctionValues.hpp.

◆ ExtinctionValues() [2/6]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::ExtinctionValues< T, Real >::ExtinctionValues ( const AltitudeView view,
const std::vector< Real > &  attr 
)
inline

Computes extinction values from a weighted view and vector attribute buffer.

Exceptions
std::invalid_argumentIf attr does not match the internal node slot count of view.topology().

Definition at line 189 of file ExtinctionValues.hpp.

◆ ExtinctionValues() [3/6]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::ExtinctionValues< T, Real >::ExtinctionValues ( const AltitudeView view,
const Real attr 
)
inline

Computes extinction values from a weighted view and raw attribute buffer.

Parameters
viewWeighted tree view whose topology and altitude define the reconstruction domain.
attrNon-null buffer indexed by dense internal NodeId.
Exceptions
std::invalid_argumentIf attr is null or if the view topology is stale.

Definition at line 200 of file ExtinctionValues.hpp.

◆ ExtinctionValues() [4/6]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::ExtinctionValues< T, Real >::ExtinctionValues ( const WeightedMorphologicalTree< T > &  weighted,
const std::shared_ptr< Real[]> &  attr 
)
inline

Computes extinction values from a weighted tree and shared attribute buffer.

The weighted tree is borrowed; it must outlive this object.

Definition at line 214 of file ExtinctionValues.hpp.

◆ ExtinctionValues() [5/6]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::ExtinctionValues< T, Real >::ExtinctionValues ( const WeightedMorphologicalTree< T > &  weighted,
const std::vector< Real > &  attr 
)
inline

Computes extinction values from a weighted tree and vector attribute buffer.

The weighted tree is borrowed; it must outlive this object.

Exceptions
std::invalid_argumentIf attr does not match the internal node slot count of the tree.

Definition at line 227 of file ExtinctionValues.hpp.

◆ ExtinctionValues() [6/6]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::ExtinctionValues< T, Real >::ExtinctionValues ( const WeightedMorphologicalTree< T > &  weighted,
const Real attr 
)
inline

Computes extinction values from a weighted tree and raw attribute buffer.

The weighted tree is borrowed; it must outlive this object.

Parameters
weightedWeighted tree whose topology and altitude define the reconstruction domain.
attrNon-null buffer indexed by dense internal NodeId.

Definition at line 241 of file ExtinctionValues.hpp.

Member Function Documentation

◆ filtering()

template<AltitudeValue T, std::floating_point Real = float>
ImagePtr< T > mmcfilters::ExtinctionValues< T, Real >::filtering ( int  extremaToKeep)
inline

Reconstructs an image by keeping the strongest extrema.

Parameters
extremaToKeepMaximum number of leaf extrema retained from the descending extinction ranking.
Returns
Image on the original image domain using altitude type T.
Exceptions
std::logic_errorIf the tree topology changed after construction.

Definition at line 293 of file ExtinctionValues.hpp.

◆ getExtinctionValues()

template<AltitudeValue T, std::floating_point Real = float>
std::vector< RegionalExtremaNode< Real > > & mmcfilters::ExtinctionValues< T, Real >::getExtinctionValues ( )
inline

Returns the extinction records sorted by decreasing extinction.

Returns
Mutable record vector kept by this object.
Exceptions
std::logic_errorIf the tree topology changed after construction.

Definition at line 340 of file ExtinctionValues.hpp.

◆ saliencyMap()

template<AltitudeValue T, std::floating_point Real = float>
ImagePtr< Real > mmcfilters::ExtinctionValues< T, Real >::saliencyMap ( int  extremaToKeep,
bool  unweighted = true 
)
inline

Builds a contour saliency image from the strongest extrema.

Parameters
extremaToKeepMaximum number of extrema retained from the descending extinction ranking.
unweightedWhen true, contours receive rank-like scores; when false, contours receive their extinction values.
Returns
Floating-point image on the original image domain.
Exceptions
std::logic_errorIf the tree topology changed after construction.

Definition at line 256 of file ExtinctionValues.hpp.


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