Skip to content

Commit

Permalink
Merge pull request #1166 from kerautret/DocExamplesListing
Browse files Browse the repository at this point in the history
Doc examples listing
  • Loading branch information
dcoeurjo authored Jun 20, 2016
2 parents b62b17e + 75d37dc commit 7543ee1
Show file tree
Hide file tree
Showing 26 changed files with 455 additions and 32 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
- Add cmake configuration file NeighborhoodTablesConfig to
decompress and install look up tables. (Pablo Hernandez-Cerdan,
[#1155](https://github.com/DGtal-team/DGtal/pull/1155))
- Check and add all DGtal examples in the Examples listing section.
(Bertrand Kerautret,[#1166](https://github.com/DGtal-team/DGtal/pull/1166))))

- *Base Package*
- Alias and ConstAlias now raise compilation error when using invalid
Expand Down
6 changes: 3 additions & 3 deletions examples/io/viewDualSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @date 2011/03/25
*
* An example file named digitalSetFromVol.
* An example file named viewDualSurface.
*
* This file is part of the DGtal library.
*/
Expand Down Expand Up @@ -393,7 +393,7 @@ int main( int argc, char** argv )
{
typedef KSpace::CellSet CellSet;
QApplication application(argc,argv);
//! [ExampleDisplay3DToOFF]

KSpace KS;

Viewer3D<Z3i::Space,Z3i::KSpace> viewer(KS);
Expand Down Expand Up @@ -444,6 +444,6 @@ int main( int argc, char** argv )
}
}
viewer << Viewer3D<>::updateDisplay;
//! [ExampleDisplay3DToOFF]

return application.exec();
}
87 changes: 87 additions & 0 deletions examples/tutorial-examples/2DSliceImageFromVol.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/**
* 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 2DSliceImageFromVol.cpp
* @ingroup tutorial-examples
* @author Bertrand Kerautret (\c [email protected] )
* LORIA (CNRS, UMR 7503), University of Lorraine, France
*
*
* @date 2016/05/09
*
* @brief Example associated to the tutorial 5 on Image adapter
*
* This file is part of the DGtal library.
*/

#include <iostream>
#include <DGtal/base/Common.h>
#include "DGtal/io/readers/GenericReader.h"
#include "DGtal/io/writers/GenericWriter.h"

#include <DGtal/helpers/StdDefs.h>
#include <DGtal/images/ImageContainerBySTLVector.h>
#include <DGtal/images/ConstImageAdapter.h>


#include "DGtal/kernel/BasicPointFunctors.h"

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



int main(int argc, char ** argv)
{

typedef ImageContainerBySTLVector<Z2i::Domain, unsigned char> Image2D;
typedef ImageContainerBySTLVector<Z3i::Domain, unsigned char> Image3D;

if(argc < 3)
{
trace.error() << "You need to indicate the volumetric image name and slice number as parameters." << std::endl;
trace.error() << std::endl;
return 1;
}
std::string filename(argv[1]);
std::string outputFileName = "sliceImage.pgm";

unsigned int numSlice = atoi(argv[2]);

trace.beginBlock("Loading file");
Image3D image3d = GenericReader< Image3D >::import ( filename );


functors::Identity id;
typedef ConstImageAdapter<Image3D, Image2D::Domain, functors::Projector<Z3i::Space>,
Image3D::Value, functors::Identity > SliceImageAdapter;
functors::Projector<Z2i::Space > proj(2);
Z2i::Domain domain2D(proj(image3d.domain().lowerBound()),
proj(image3d.domain().upperBound()));

DGtal::functors::Projector<Z3i::Space> aSliceFunctor(numSlice);
aSliceFunctor.initAddOneDim(2);
SliceImageAdapter sliceImageZ(image3d, domain2D, aSliceFunctor, id);

trace.endBlock();

trace.beginBlock("Exporting...");
sliceImageZ >> outputFileName;
trace.endBlock();
return 0;
}
1 change: 1 addition & 0 deletions examples/tutorial-examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SET(DGTAL_TUTO_EXAMPLES_SRC
shapeGridCurveEstimator
freemanChainFromImage
FMMErosion
2DSliceImageFromVol
)


Expand Down
6 changes: 1 addition & 5 deletions examples/tutorial-examples/volDTGranulo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ int main(int argc, char ** argv)
trace.info() << "Got "<<cpt<<" points."<<std::endl;
viewer3 << DGtal::Viewer3D<>::updateDisplay;
trace.info() << "viewer3 launched..."<<std::endl;
res = res&& application3.exec();
return application3.exec();

if (res)
return 0;
else
return 1;
}
53 changes: 48 additions & 5 deletions src/DGtal/dec/doc/packageDEC.dox
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ namespace DGtal {
Discrete exterior calculus (DEC) provides an easy and efficient way to describe linear operator over various structure.
Basic operators, such as Hodge duality operator or exterior derivative, can be combined to create classical vector analysis operator such as gradient, curl and divergence.

@note To use this package, you have to build DGtal with the Eigen option (and with Cairo option to have the examples compiled). By using cmake you have to use these options: -DWITH_EIGEN=true -DWITH_CAIRO=true.

@b Modules
- \ref moduleDECIntroduction
- \ref moduleDECEmbedding
Expand All @@ -60,14 +62,55 @@ Basic operators, such as Hodge duality operator or exterior derivative, can be c
@b Related @b documentation @b pages

@b Related @b examples
- testDiscreteExteriorCalculus.cpp
- exampleDECSurface.cpp
- examplePropagation.cpp
- exampleDiscreteExteriorCalculusUsage.cpp
- exampleDiscreteExteriorCalculusSolve.cpp
- examplePropagation.cpp
- testLinearStructure.cpp
- testEmbedding.cpp
- exampleDECSurface.cpp
- exampleDiscreteExteriorCalculusChladni.cpp

*/



/**
Example of Discrete Exterior Calculus with Chladni.
@see \ref sectDECHelmoltzProblem
\image html exampleDECChladni.png "Primal Helmoltz decomposition harmonic component."
\example dec/exampleDiscreteExteriorCalculusChladni.cpp
**/


/**
Example of primal and dual Helmoltz decomposition in 2D and 3D using Discrete Exterior Calculus.
@see \ref sectDECHelmoltzProblem
\image html solve_2d_primal_decomposition_calculusSmall.png "Primal Helmoltz decomposition harmonic component."
\example dec/exampleDiscreteExteriorCalculusSolve.cpp
**/



/**
Example of vector field manipulation using Discrete Exterior Calculus.
@see \ref sectDECIntroduction
\image html usage_primal_one_form_sharp_flat.png "Flat sharped primal gradient vector field."
\example dec/exampleDiscreteExteriorCalculusUsage.cpp
**/



/**
Example of solving Poisson equation using the DEC package.
@see \ref sectDECPoissonProblem
\image html alcapone_phi.png "Solution dual 0-form."
\example dec/exampleDECSurface.cpp
**/


/**
Example of 2D wave propagation using the DEC package.
@see \ref moduleDECPropagation
\image html propagation_time_wave_ii.gif "You should obtain such wave propagation (by converting svg files)."
\example dec/examplePropagation.cpp
**/

}
6 changes: 6 additions & 0 deletions src/DGtal/doc/tutorials/tutoAreaSurface.dox
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,10 @@ VoronoiCovarianceMeasureLocalEstimator.

*/


/**
Example of tutorial 4: Surface area estimation
@see @ref tutoAreaSurface
\example tutorial-examples/AreaSurfaceEstimation-final.cpp
**/
}
9 changes: 9 additions & 0 deletions src/DGtal/doc/tutorials/tutoFMMErosion.dox
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,13 @@ Once these types are defined, you can construct your new point predicate as foll

*/

/**
Example of tutorial 1: Local morphological opening of a 3d volume by the Fast Marching Method
@see @ref tutoFMMErosion
\image html tutoFMMerode.png "erosion using FMM."
@example tutorial-examples/FMMErosion.cpp

*/


}
19 changes: 14 additions & 5 deletions src/DGtal/doc/tutorials/tutoImageManipulations.dox
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ To apply the extraction you can follow these steps:
- type of the source Image (Image3D).
- the domain type of the resulting image (Image2D::Domain).
- the functor taking in input 2D data and return 3D
points (DGtal::Projector<Z3i::Space>) to access to source image data.
points ( DGtal::functors::Projector<Z3i::Space>) to access to source image data.
- the type of value of the 3D image (Image3D::Value)
- the functor type to be applied on the source image value during the reading process.
\code
typedef DGtal::ConstImageAdapter<Image3D, Image2D::Domain, DGtal::Projector<Z3i::Space>,
Image3D::Value, DGtal::DefaultFunctor > SliceImageAdapter;
\code
typedef ConstImageAdapter<Image3D, Image2D::Domain, functors::Projector<Z3i::Space>,
Image3D::Value, functors::Identity > SliceImageAdapter;
\endcode


Expand All @@ -167,7 +167,7 @@ should obtain the following image:
@subsubsection subsubsectHintsImageExtractionIntroTutoImageManipulations Hints:
- To construct the domain of the resulting image you can use a projector:
\code
DGtal::Projector<Z2i::Space > proj(2);
DGtal::functors::Projector<Z2i::Space > proj(2);
DGtal::Z2i::Domain domain2D(proj(image3d.domain().lowerBound()),
proj(image3d.domain().upperBound()));
\endcode
Expand Down Expand Up @@ -214,6 +214,15 @@ the previous image you should obtain:

*/

/**
Example of tutorial 5: ImageAdapter: some simple image manipulations
@see @ref tutoImageManipulations
\image html slice20Lobster.png " Result of slice image number 20 on Z axis."
@example tutorial-examples/2DSliceImageFromVol.cpp
**/



}


Expand Down
7 changes: 7 additions & 0 deletions src/DGtal/doc/tutorials/tutoPolyhedralisation.dox
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,12 @@ $ ./examples/tutorial-examples/polyhedralizer
\example examples/tutorial-examples/polyhedralizer.cpp
*/

/**
Example of tutorial 2: making a polyhedron from a digital object
@see @ref tutoPolyhedralisation
\image html polyhedral-al-finished-w3.png "The polyhedral surface approaching Al Capone digital object, for width=3/1."
@example tutorial-examples/polyhedralizer.cpp

*/

}
9 changes: 9 additions & 0 deletions src/DGtal/doc/tutorials/tutoVolDTGranulometry.dox
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,13 @@ propagation based granulometric/thickness function from the PowerMap

*/

/**
Example of tutorial 3: Volumetric analysis and Granulometry
@see @ref tutoVolDTGranulometry
\image html tutoVolDTGranulometry.png "result on obtained examples/samples/Al.100.vol."
@example tutorial-examples/volDTGranulo.cpp

*/


}
12 changes: 6 additions & 6 deletions src/DGtal/geometry/doc/moduleVolumetric.dox
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,17 @@ ExactPredicateLpPowerSeparableMetric, see @ref moduleMetrics
Example of a Voronoi map construction in dimension 2 for the
Eucldiean metric.

@see \ref voronoiSect

\example geometry/volumes/distance/voronoimap2D.cpp
@see \ref voronoiSect
\image html voronoimap-dt.png "Distance transformation for the l_2 metric."
\example geometry/volumes/distance/voronoimap2D.cpp
*/

/**
Example of distance transformation in dimension 2.

@see \ref moduleVolumetric

\example geometry/volumes/distance/distancetransform2D.cpp
@see \ref moduleVolumetric
\image html example-DT-L2.png "Distance transform with L2 norm."
\example geometry/volumes/distance/distancetransform2D.cpp
*/

/**
Expand Down
30 changes: 29 additions & 1 deletion src/DGtal/geometry/doc/packageGeometry.dox
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,39 @@ of arbitrary dimension, by the means of separable and incremental distance trans
@b Related @b documentation @b pages

@b Related @b examples

- exampleCurvature.cpp
- voronoimap2D.cpp, distancetransform3D.cpp, distancetransform2D.cpp
- viewer3D-7-planes.cpp , viewer3D-7bis-planes.cpp , viewer3D-7-stdplane.cpp , viewer3D-7bis-stdplane.cpp , greedy-plane-segmentation.cpp , greedy-plane-segmentation-ex2.cpp
- exampleConvexHull2D.cpp, exampleAlphaShape.cpp

*/

}

/**
Example of geometric predicates.
@see @ref moduleGeometricPredicates
\example geometry/tools/determinant/exampleInHalfPlane.cpp
**/


/**
Example of curvature estimation based on Digital Circular Arc (DCA) estimator.
\image html exampleCurvature.png "Curvature estimated using DCA estimator on a flower shape."
\example geometry/curves/estimation/exampleCurvature.cpp
**/


/**
Example of DSLSubsegment.
\example geometry/curves/exampleDSLSubsegment.cpp
**/



/**
Example of Preimage2D.
\image html preimageExample2.png "Example of preimage based arc recognition."
\example geometry/tools/examplePreimage.cpp
**/

10 changes: 10 additions & 0 deletions src/DGtal/images/doc/moduleBigImages.dox
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,13 @@ And finally, here is the modified original image after the two writings.
*/

}


/**
* Example of HDF5 ImageFactory.
@see @ref dgtalBigImagesAbstract

\image html TiledImageFromImage-11-write.png "Example of writing in cache. "
* \example images/exampleImageFactoryFromHDF5.cpp
**/

Loading

0 comments on commit 7543ee1

Please sign in to comment.