DGtal 1.4.0
|
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) More...
#include <DGtal/topology/ParDirCollapse.h>
Public Types | |
typedef CC::KSpace | KSpace |
Any model of concepts::CCellularGridSpaceND, i.e. a type that models a Khalimsky space. | |
typedef CC::Point | Point |
Type of integer point. | |
typedef CC::Size | Size |
Type of containers size. | |
typedef KSpace::Cell | Cell |
Type of cells in Khalimsky space. | |
typedef KSpace::Cells | Cells |
Type of collection of cells. | |
typedef CC::CellMapConstIterator | CellMapConstIterator |
Type of const iterator over a map of cells. | |
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 () |
Data Fields | |
bool | verbose = true |
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) | |
ParDirCollapse & | operator= (const ParDirCollapse &other) |
Private Attributes | |
const KSpace & | K |
Reference to Khalimsky space in which a given complex is embedded. | |
CC * | complex |
Pointer to complex. | |
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'
CC | cubical complex. |
Definition at line 77 of file ParDirCollapse.h.
typedef KSpace::Cell DGtal::ParDirCollapse< CC >::Cell |
Type of cells in Khalimsky space.
Definition at line 90 of file ParDirCollapse.h.
typedef CC::CellMapConstIterator DGtal::ParDirCollapse< CC >::CellMapConstIterator |
Type of const iterator over a map of cells.
Definition at line 94 of file ParDirCollapse.h.
typedef KSpace::Cells DGtal::ParDirCollapse< CC >::Cells |
Type of collection of cells.
Definition at line 92 of file ParDirCollapse.h.
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.
typedef CC::Point DGtal::ParDirCollapse< CC >::Point |
Type of integer point.
Definition at line 86 of file ParDirCollapse.h.
typedef CC::Size DGtal::ParDirCollapse< CC >::Size |
Type of containers size.
Definition at line 88 of file ParDirCollapse.h.
DGtal::ParDirCollapse< CC >::ParDirCollapse | ( | const KSpace & | k | ) |
Constructor.
k | – const reference to Khalimsky space |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
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.
pComplex | – Cubical complex |
Referenced by main(), and TEST_CASE().
|
private |
|
private |
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.
Referenced by main(), and TEST_CASE().
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.
Referenced by main(), and TEST_CASE().
|
private |
Calculate an orientation of a freepair.
F | – cell of a dimension one lower than G. |
G | – cell of a dimension one higher than F. |
orient | – freepair orientation |
dir | – freepair direction |
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.
iterations | – number of iterations |
Referenced by main(), and TEST_CASE().
|
private |
Calculate an orientation of a freepair.
F | – cell of a dimension one lower than G. |
G | – cell of a dimension one higher than F. |
|
private |
Calculate an orientation of a freepair.
F | – cell of a dimension one lower than G. |
G | – cell of a dimension one higher than 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.
F | – cell of dimension one lower than KSpace. |
|
private |
Check if a given face of dimension n is included in a face of dimmension n + 1.
F | – cell of dimension smaller than KSpace::dimension. |
bool DGtal::ParDirCollapse< CC >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
private |
Assignment.
other | the object to copy. |
|
private |
Pointer to complex.
Definition at line 215 of file ParDirCollapse.h.
|
private |
Reference to Khalimsky space in which a given complex is embedded.
Definition at line 213 of file ParDirCollapse.h.
bool DGtal::ParDirCollapse< CC >::verbose = true |
Definition at line 218 of file ParDirCollapse.h.