Milena (Olena)  User documentation 2.0a Id
 All Classes Namespaces Functions Variables Typedefs Enumerator Groups Pages
mln::labeled_image_base< I, E > Class Template Reference

Base class Morpher providing an improved interface for labeled image. More...

#include <labeled_image_base.hh>

Inheritance diagram for mln::labeled_image_base< I, E >:
Inheritance graph

Public Types

typedef accu::shape::bbox
< typename I::psite >::result 
bbox_t
 Type of the bounding component bounding boxes.
 

Public Member Functions

const bbox_tbbox (const typename I::value &label) const
 Return the bounding box of the component label.
 
const util::array< bbox_t > & bboxes () const
 Return the component bounding boxes.
 
I::value nlabels () const
 Return the number of labels;.
 
p_if< mln_box(I),
fun::eq_v2b_expr_< pw::value_
< I >, pw::cst_< typename
I::value > > > 
subdomain (const typename I::value &label) const
 Return the domain of the component with label label.
 
 labeled_image_base ()
 ConstructorsConstructor without argument.
 
template<typename F >
void relabel (const Function_v2v< F > &f)
 Relabel according to a function.
 
template<typename F >
void relabel (const Function_v2b< F > &f)
 Labels may be removed.
 

Protected Member Functions

void update_data (const fun::i2v::array< typename I::value > &relabel_fun)
 Update bounding boxes information.
 

Detailed Description

template<typename I, typename E>
class mln::labeled_image_base< I, E >

Base class Morpher providing an improved interface for labeled image.

Template Parameters
IThe label image type.

This image type allows to access every site set at a given label.

This image type guaranties that labels are contiguous (from 1 to n).

Definition at line 116 of file labeled_image_base.hh.

Member Typedef Documentation

template<typename I, typename E>
typedef accu::shape::bbox<typename I ::psite>::result mln::labeled_image_base< I, E >::bbox_t

Type of the bounding component bounding boxes.

Definition at line 124 of file labeled_image_base.hh.

Constructor & Destructor Documentation

template<typename I , typename E >
labeled_image_base< I, E >::labeled_image_base ( )
inline

ConstructorsConstructor without argument.

Definition at line 217 of file labeled_image_base.hh.

Member Function Documentation

template<typename I, typename E >
const labeled_image_base< I, E >::bbox_t & labeled_image_base< I, E >::bbox ( const typename I::value &  label) const

Return the bounding box of the component label.

Definition at line 305 of file labeled_image_base.hh.

template<typename I , typename E >
const util::array< typename labeled_image_base< I, E >::bbox_t > & labeled_image_base< I, E >::bboxes ( ) const

Return the component bounding boxes.

Definition at line 313 of file labeled_image_base.hh.

template<typename I , typename E >
I::value labeled_image_base< I, E >::nlabels ( ) const
inline

Return the number of labels;.

Definition at line 273 of file labeled_image_base.hh.

template<typename I , typename E >
template<typename F >
void labeled_image_base< I, E >::relabel ( const Function_v2v< F > &  f)
inline

Relabel according to a function.

Merge or delete labels according to the given function. This method ensures that the labeling remains contiguous.

Definition at line 226 of file labeled_image_base.hh.

References mln::labeling::relabel_inplace(), and mln::make::relabelfun().

template<typename I , typename E >
template<typename F >
void labeled_image_base< I, E >::relabel ( const Function_v2b< F > &  f)
inline

Labels may be removed.

This overload make sure the labeling is still contiguous.

Definition at line 252 of file labeled_image_base.hh.

References mln::labeling::relabel_inplace(), and mln::make::relabelfun().

template<typename I, typename E >
p_if< mln_box(I), fun::eq_v2b_expr_< pw::value_< I >, pw::cst_< typename I::value > > > labeled_image_base< I, E >::subdomain ( const typename I::value &  label) const

Return the domain of the component with label label.

Definition at line 322 of file labeled_image_base.hh.

template<typename I, typename E >
void labeled_image_base< I, E >::update_data ( const fun::i2v::array< typename I::value > &  relabel_fun)
protected

Update bounding boxes information.

Definition at line 281 of file labeled_image_base.hh.

References mln::util::array< T >::size().