DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::ParDirCollapse< CC > Class Template Reference

#include <DGtal/topology/ParDirCollapse.h>

Collaboration diagram for DGtal::ParDirCollapse< CC >:
[legend]

Public Types

typedef CC::KSpace KSpace
 
typedef CC::Point Point
 
typedef CC::Size Size
 
typedef KSpace::Cell Cell
 
typedef KSpace::Cells Cells
 
typedef CC::CellMapConstIterator CellMapConstIterator
 

Public Member Functions

bool isValid () const
 
 ParDirCollapse (const KSpace &k)
 
void attach (Alias< CC > pComplex)
 
unsigned int eval (unsigned int iterations)
 
void collapseSurface ()
 
void collapseIsthmus ()
 

Protected Member Functions

 ParDirCollapse ()
 

Private Member Functions

 BOOST_STATIC_ASSERT ((CC::KSpace::dimension >=2))
 
 BOOST_CONCEPT_ASSERT ((boost::Container< CC >))
 
int getOrientation (const Cell &F, const Cell &G) const
 
int getDirection (const Cell &F, const Cell &G) const
 
bool completeFreepair (CellMapConstIterator F, Cell &G, int orient, int dir)
 
bool isNotIncludedInUpperDim (CellMapConstIterator F)
 
bool isIsthmus (CellMapConstIterator F)
 
 ParDirCollapse (const ParDirCollapse &other)
 
ParDirCollapseoperator= (const ParDirCollapse &other)
 

Private Attributes

const KSpaceK
 
CCcomplex
 

Detailed Description

template<typename CC>
class DGtal::ParDirCollapse< CC >

Aim: Implements thinning algorithms in cubical complexes. The implementation supports any model of cubical complex, for instance a DGtal::CubicalComplex< KhalimskySpaceND< 3, int > >. Three approaches are provided. The first—ParDirCollapse—bases on directional collapse of free pairs of faces. Second—CollapseSurface—is an extension of ParDirCollapse such that faces of dimension one lower than the dimension of the complex are kept. The last approach —CollapseIsthmus—is also an extension of ParDirCollapse such that faces of dimension one lower than the complex are preserved when they do not contain free faces of dimension two lower than the complex. Paper: Chaussard, J. and Couprie, M., Surface Thinning in 3D Cubical Complexes, Combinatorial Image Analysis, (2009)

Description of class 'ParDirCollapse'

Template Parameters
CCcubical complex.

Definition at line 77 of file ParDirCollapse.h.

Member Typedef Documentation

template<typename CC>
typedef KSpace::Cell DGtal::ParDirCollapse< CC >::Cell

Type of cells in Khalimsky space.

Definition at line 90 of file ParDirCollapse.h.

Type of const iterator over a map of cells.

Definition at line 94 of file ParDirCollapse.h.

template<typename CC>
typedef KSpace::Cells DGtal::ParDirCollapse< CC >::Cells

Type of collection of cells.

Definition at line 92 of file ParDirCollapse.h.

template<typename CC>
typedef CC::KSpace DGtal::ParDirCollapse< CC >::KSpace

Any model of concepts::CCellularGridSpaceND, i.e. a type that models a Khalimsky space.

Definition at line 84 of file ParDirCollapse.h.

template<typename CC>
typedef CC::Point DGtal::ParDirCollapse< CC >::Point

Type of integer point.

Definition at line 86 of file ParDirCollapse.h.

template<typename CC>
typedef CC::Size DGtal::ParDirCollapse< CC >::Size

Type of containers size.

Definition at line 88 of file ParDirCollapse.h.

Constructor & Destructor Documentation

template<typename CC>
DGtal::ParDirCollapse< CC >::ParDirCollapse ( const KSpace k)

Constructor.

Parameters
k– const reference to Khalimsky space
template<typename CC>
DGtal::ParDirCollapse< CC >::ParDirCollapse ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

template<typename CC>
DGtal::ParDirCollapse< CC >::ParDirCollapse ( const ParDirCollapse< CC > &  other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

template<typename CC>
void DGtal::ParDirCollapse< CC >::attach ( Alias< CC pComplex)

This method should be use to point to a complex to which one wish to apply one of the thinning algorithms.

Parameters
pComplex– Cubical complex
template<typename CC>
DGtal::ParDirCollapse< CC >::BOOST_CONCEPT_ASSERT ( (boost::Container< CC >)  )
private
template<typename CC>
DGtal::ParDirCollapse< CC >::BOOST_STATIC_ASSERT ( (CC::KSpace::dimension >=2)  )
private
template<typename CC>
void DGtal::ParDirCollapse< CC >::collapseIsthmus ( )

Extension of basic algorithm—ParDirCollapse—which preserve KSpace::dimension - 1 faces which are not included in any KSpace::dimension cells. Moreover, cells to be kept have not to be collapsible.

template<typename CC>
void DGtal::ParDirCollapse< CC >::collapseSurface ( )

Extension of basic algorithm—ParDirCollapse—which preserve KSpace::dimension - 1 faces which are not included in any KSpace::dimension cells.

template<typename CC>
bool DGtal::ParDirCollapse< CC >::completeFreepair ( CellMapConstIterator  F,
Cell G,
int  orient,
int  dir 
)
private

Calculate an orientation of a freepair.

Parameters
F– cell of a dimension one lower than G.
G– cell of a dimension one higher than F.
orient– freepair orientation
dir– freepair direction
Returns
– true if G was found as collapisble, false otherwise.
template<typename CC>
unsigned int DGtal::ParDirCollapse< CC >::eval ( unsigned int  iterations)

This method applies a given number of iterations to a complex provided by the attach() method.

Parameters
iterations– number of iterations
Returns
total number of removed cells.
template<typename CC>
int DGtal::ParDirCollapse< CC >::getDirection ( const Cell F,
const Cell G 
) const
private

Calculate an orientation of a freepair.

Parameters
F– cell of a dimension one lower than G.
G– cell of a dimension one higher than F.
template<typename CC>
int DGtal::ParDirCollapse< CC >::getOrientation ( const Cell F,
const Cell G 
) const
private

Calculate an orientation of a freepair.

Parameters
F– cell of a dimension one lower than G.
G– cell of a dimension one higher than F.
template<typename CC>
bool DGtal::ParDirCollapse< CC >::isIsthmus ( CellMapConstIterator  F)
private

Check if a given face of dimension: KSpace::dimension - 1, does not constitute a freepair. Note that, a given face has to not be included in any face of dimension: KSpace::dimension.

Parameters
F– cell of dimension one lower than KSpace.
Returns
true if F does not constitute a freepair and false otherwise.
template<typename CC>
bool DGtal::ParDirCollapse< CC >::isNotIncludedInUpperDim ( CellMapConstIterator  F)
private

Check if a given face of dimension n is included in a face of dimmension n + 1.

Parameters
F– cell of dimension smaller than KSpace::dimension.
Returns
true if a face is not included in any other and false otherwise.
template<typename CC>
bool DGtal::ParDirCollapse< CC >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename CC>
ParDirCollapse& DGtal::ParDirCollapse< CC >::operator= ( const ParDirCollapse< CC > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

Field Documentation

template<typename CC>
CC* DGtal::ParDirCollapse< CC >::complex
private

Pointer to complex.

Definition at line 215 of file ParDirCollapse.h.

template<typename CC>
const KSpace& DGtal::ParDirCollapse< CC >::K
private

Reference to Khalimsky space in which a given complex is embedded.

Definition at line 213 of file ParDirCollapse.h.


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