Functions

mln::morpho::tree::filter Namespace Reference

Namespace for attribute filtering. More...

Functions

template<typename T , typename F , typename P >
void direct (const T &tree, Image< F > &f_, const Function_v2b< P > &pred_)
 Direct non-pruning strategy.
template<typename T , typename F , typename P >
void filter (const T &tree, Image< F > &f_, const Function_v2b< P > &pred_, const typename F::value &v)
 Filter the image f_ with a given value.
template<typename T , typename F , typename P >
void max (const T &tree, Image< F > &f_, const Function_v2b< P > &pred_)
 Max pruning strategy.
template<typename T , typename F , typename P >
void min (const T &tree, Image< F > &f_, const Function_v2b< P > &pred_)
 Min pruning strategy.
template<typename T , typename F , typename P >
void subtractive (const T &tree, Image< F > &f_, const Function_v2b< P > &pred_)
 Subtractive pruning strategy.

Detailed Description

Namespace for attribute filtering.


Function Documentation

template<typename T , typename F , typename P >
void mln::morpho::tree::filter::direct ( const T &  tree,
Image< F > &  f_,
const Function_v2b< P > &  pred_ 
) [inline]

Direct non-pruning strategy.

A node is removed if it does not verify the predicate. The sub-components remain intact.

Parameters:
[in] tree Component tree.
[out] f_ Image to filter.
[in] pred_ Filtering criterion.

Definition at line 73 of file direct.hh.

template<typename T , typename F , typename P >
void mln::morpho::tree::filter::filter ( const T &  tree,
Image< F > &  f_,
const Function_v2b< P > &  pred_,
const typename F::value &  v 
) [inline]

Filter the image f_ with a given value.

The sub-components of nodes that does not match the predicate pred_ are filled with the given value v.

Parameters:
tree Component tree.
f_ Image function.
pred_ Predicate.
v Value to propagate.

Definition at line 73 of file morpho/tree/filter/filter.hh.

References mln::data::fill(), and mln::initialize().

template<typename T , typename F , typename P >
void mln::morpho::tree::filter::max ( const T &  tree,
Image< F > &  f_,
const Function_v2b< P > &  pred_ 
) [inline]

Max pruning strategy.

A node is removed iif all of its children are removed or if it does not verify the predicate pred_.

Parameters:
[in] tree Component tree.
[out] f_ Image to filter.
[in] pred_ Filtering criterion.

Definition at line 74 of file morpho/tree/filter/max.hh.

References mln::data::fill(), and mln::initialize().

template<typename T , typename F , typename P >
void mln::morpho::tree::filter::min ( const T &  tree,
Image< F > &  f_,
const Function_v2b< P > &  pred_ 
) [inline]

Min pruning strategy.

A node is removed iif its parent is removed or if it does not verify the predicate pred_.

Parameters:
[in] tree Component tree.
[out] f_ Image to filter.
[in] pred_ Filtering criterion.

Definition at line 75 of file morpho/tree/filter/min.hh.

References mln::data::fill(), and mln::initialize().

template<typename T , typename F , typename P >
void mln::morpho::tree::filter::subtractive ( const T &  tree,
Image< F > &  f_,
const Function_v2b< P > &  pred_ 
) [inline]

Subtractive pruning strategy.

The node is removed if it does not verify the predicate. The sub-components values are set to the value of the removed component.

Parameters:
[in] tree Component tree.
[out] f_ Image to filter.
[in] pred_ Filtering criterion.

Definition at line 77 of file subtractive.hh.

References mln::morpho::tree::propagate_if().