Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Par dir collapse #1199

Merged
merged 35 commits into from Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
74470f7
Initial version
Jan 14, 2016
cee00f0
First version which compiles after clean ups.
copyme Jan 14, 2016
91e82c8
Some clean ups
copyme Jan 14, 2016
617e2ad
Refactorization. Small bug fix.
copyme Jan 15, 2016
8b05c3e
Refactorization.
copyme Jan 15, 2016
ef1d3dd
Assertions, types, cleanups
copyme Jan 16, 2016
ec7b695
small fix for priority
copyme Jan 16, 2016
49a5d3b
Fixes for bugs introduced in the previous commits.
copyme Jan 16, 2016
d62b494
check for a concept
copyme Jan 16, 2016
759e03e
fix for "control may reach end of non-void function"
copyme Jan 16, 2016
284b1b9
example which shows how to use ParDirCollapse
copyme Jan 16, 2016
d161cb4
removed useless include
copyme Jan 16, 2016
382707b
same as before
copyme Jan 16, 2016
c2258c3
test for ParDirCollapse and example enabled in CMake
copyme Jan 16, 2016
51db3e9
formatting
copyme Jan 16, 2016
3dc03e9
Merge branch 'master' of https://github.com/DGtal-team/DGtal into Par…
copyme Jan 16, 2016
e8ac525
Merge branch 'master' of https://github.com/DGtal-team/DGtal into Par…
copyme Jan 19, 2016
271d643
fixes for types shadowing.
copyme Jan 19, 2016
d55aacc
Merge branch 'master' of https://github.com/DGtal-team/DGtal into Par…
copyme Jan 21, 2016
4652482
fix for unused variables
copyme Jan 21, 2016
cc6912a
missing authors
copyme Jan 21, 2016
c559d83
merge
Jul 13, 2016
3c6fb6e
Documentation for ParDirCollapse
Jul 13, 2016
d295475
sync of tags for doc
Jul 14, 2016
b504056
fixes for captions of images
copyme Jul 14, 2016
92c3c7d
revert and add new entry
Jul 15, 2016
a4632f2
Merge branch 'master' of https://github.com/DGtal-team/DGtal
Sep 28, 2016
fdb8b7c
Merge branch 'master' into ParDirCollapse
Sep 28, 2016
ed4f588
Entry in the changelog and fix for a typo
Sep 28, 2016
f6f672c
typos and missing references
copyme Dec 23, 2016
6feb84a
Descriptions, fixes for types and few others minor changes.
copyme Dec 23, 2016
f5a1b17
Type are now correctly resolved.
copyme Dec 24, 2016
0aa2f66
tautology fixed.
copyme Dec 24, 2016
11bd0bf
Update moduleCubicalComplex.dox
copyme Jan 19, 2017
4fe3e78
Update moduleCubicalComplex.dox
copyme Jan 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion AUTHORS
Expand Up @@ -18,4 +18,7 @@ Kacper Pluta <kacper.pluta@esiee.fr>
Nicolas Normand <Nicolas.Normand@polytech.univ-nantes.fr>
Roland Denis <Roland.Denis@univ-savoie.fr>
Nicolas Aubry <nicolas.aubry@loria.fr>
Van Tho Nguyen <vantho.nguyen@nancy.inra.fr>
Van Tho Nguyen <vantho.nguyen@nancy.inra.fr>
Mohamad Onayssi <mohamad.onayssi@edu.esiee.fr>
Bibiana Martinez <bibiana.martinez@edu.esiee.fr>
Mohamed Mellouli <mohamed.mellouli@edu.esiee.fr>
6 changes: 5 additions & 1 deletion ChangeLog.md
Expand Up @@ -6,6 +6,11 @@
- Fixing errors and warnings raised by g++ 4.7.x.
(Roland Denis, [#1202](https://github.com/DGtal-team/DGtal/pull/1202))

- *Topology Package*
- Implementation of ParDirCollapse with CollapseSurface and CollapseIsthmus.
(Mohamad ONAYSSI, Bibiana MARTINEZ, Mohamed MELLOULI, Kacper PLUTA,
[#1199](https://github.com/DGtal-team/DGtal/pull/1199))

# DGtal 0.9.2

## New Features / Critical Changes
Expand Down Expand Up @@ -87,7 +92,6 @@
- Add pre-calculated look up tables to speed up Object::isSimple calculations.
(Pablo Hernandez-Cerdan, [#1155](https://github.com/DGtal-team/DGtal/pull/1155))


## Bug Fixes
- *Configuration/General*
- Simplification of the windows build instructions. (David
Expand Down
1 change: 1 addition & 0 deletions examples/topology/CMakeLists.txt
Expand Up @@ -10,6 +10,7 @@ SET(DGTAL_EXAMPLES_TOPO_SRC
generateSimplicityTables3D
digitalSetToCubicalComplexes2D
cubical-complex-illustrations
cubicalComplexThinning
)

FOREACH(FILE ${DGTAL_EXAMPLES_TOPO_SRC})
Expand Down
146 changes: 146 additions & 0 deletions examples/topology/cubicalComplexThinning.cpp
@@ -0,0 +1,146 @@
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**/

/**
* @file cubicalComplexThinning.cpp
* @ingroup Examples
* @author Kacper Pluta (\c kacper.pluta@esiee.fr )
* Laboratoire d'Informatique Gaspard-Monge - LIGM, France
*
* @date 2016/01/16
*
* An example file named cubicalComplexThinning.
*
* This file is part of the DGtal library.
*/

///////////////////////////////////////////////////////////////////////////////
#include "ConfigExamples.h"
#include "DGtal/helpers/StdDefs.h"
// Cellular grid
#include "DGtal/topology/CubicalComplex.h"
//! [include]
#include "DGtal/topology/ParDirCollapse.h"
//! [include]
// Shape construction
#include "DGtal/shapes/GaussDigitizer.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/shapes/EuclideanShapesDecorator.h"
#include "DGtal/shapes/parametric/Flower2D.h"
// Drawing
#include "DGtal/io/boards/Board2D.h"
///////////////////////////////////////////////////////////////////////////////

using namespace std;
using namespace DGtal;
using namespace Z2i;

///////////////////////////////////////////////////////////////////////////////

template <typename CC, typename KSpace>
void getComplex ( CC & complex, KSpace & K )
{
typedef Flower2D< Space > MyEuclideanShape;
MyEuclideanShape shape( RealPoint( 0.0, 0.0 ), 16, 5, 5, M_PI_2/2. );

typedef GaussDigitizer< Space, MyEuclideanShape > MyGaussDigitizer;
MyGaussDigitizer digShape;
digShape.attach( shape );
digShape.init ( shape.getLowerBound(), shape.getUpperBound(), 1.0 );
Domain domainShape = digShape.getDomain();
DigitalSet aSet( domainShape );
Shapes<Domain>::digitalShaper( aSet, digShape );

K.init ( domainShape.lowerBound(), domainShape.upperBound(), true );
complex.clear();
complex.construct ( aSet );
}

template <typename CC>
void drawComplex ( Board2D & board, CC & complex )
{
board.clear();
typedef typename CC::CellMapConstIterator CellMapConstIterator;
for ( Dimension d = 0; d <= 2; ++d )
for ( CellMapConstIterator it = complex.begin( d ), itE = complex.end( d );
it != itE; ++it )
{
if ( d == 0 )
board << CustomStyle( it->first.className(),
new CustomColors( Color( 0, 0, 0 ),
Color( 0, 0, 0 ) ) );
else if ( d == 1 )
board << CustomStyle( it->first.className(),
new CustomColors( Color( 200, 0, 0 ),
Color( 100, 255, 100 ) ) );
else
board << CustomStyle( it->first.className(),
new CustomColors( Color( 0, 0, 200 ),
Color( 100, 255, 100 ) ) );
board << it->first;
}
}

///////////////////////////////////////////////////////////////////////////////
// //


int main( int, char** )
{
typedef map<Cell, CubicalCellData> Map;
typedef CubicalComplex< KSpace, Map > CC;
Board2D board;
KSpace K;
CC complex ( K );
//! [create]
ParDirCollapse < CC > thinning ( K );
//! [create]
trace.beginBlock ( "ParDirCollapse -- 2 iterations." );
getComplex< CC, KSpace > ( complex, K );
drawComplex<CC> ( board, complex );
board.saveEPS ( "ComplexBeforeThinning.eps" );
//! [init]
thinning.attach ( &complex );
//! [init]

//! [thinn]
thinning.eval ( 2 );
//! [thinn]
drawComplex<CC> ( board, complex );
board.saveEPS ( "ParDirCollapse_2.eps" );
trace.endBlock();

trace.beginBlock ( "ParDirCollapse -- collapseSurface." );
getComplex< CC, KSpace > ( complex, K );
thinning.attach ( &complex );
//! [thinnSurface]
thinning.collapseSurface ();
//! [thinnSurface]
drawComplex<CC> ( board, complex );
board.saveEPS ( "ParDirCollapse_collapseSurface.eps" );
trace.endBlock();

trace.beginBlock ( "ParDirCollapse -- collapseIsthmus." );
getComplex< CC, KSpace > ( complex, K );
thinning.attach ( &complex );
//! [thinnIsthmus]
thinning.collapseIsthmus ();
//! [thinnIsthmus]
drawComplex<CC> ( board, complex );
board.saveEPS ( "ParDirCollapse_collapseIsthmus.eps" );
trace.endBlock();
return 0;
}
24 changes: 24 additions & 0 deletions src/DGtal/doc/global.bib
Expand Up @@ -910,3 +910,27 @@ @article{kerautret_meaningful_2012
pages = {2379--2392}
}


@inproceedings{Chaussard:IWCIA:09,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a "journal" version of this publication ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to my knowledge there is no journal version.

author = {Chaussard, John and Couprie, Michel},
booktitle = {IWCIA},
editor = {Wiederhold, Petra and Barneva, Reneta P.},
pages = {135–148},
publisher = {Springer},
series = {Lecture Notes in Computer Science},
title = {Surface Thinning in 3D Cubical Complexes.},
volume = 5852,
year = 2009
}


@article{Latecki:ER:95,
author = {Latecki, Longin Jan and Eckhardt, Ulrich and Rosenfeld, Azriel},
journal = {Computer Vision and Image Understanding},
number = 1,
pages = {70–83},
title = {{Well-Composed Sets.}},
volume = 61,
year = 1995
}