-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Doc examples listing #1166
Doc examples listing #1166
Changes from 21 commits
8dbc624
f28861d
1a16767
334fdab
dfc3269
a17f588
10b37c5
5ef6c82
2aaa3ee
b1077e3
fb166e3
eb684f5
448bfc6
33fee0f
666c26c
0c6476b
c9f47ad
107e469
8fb2821
cdf37ee
4a00cfc
ac94263
2dd98b8
1249a3b
cd4ce21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As an example to my comment: \example and @example must be moved to the example source code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes sure, now we can easily see with this PR which example should be completed.
yes, It should be a good idea and it could be more easy to check if all examples where documented ;) |
||
@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 | ||
**/ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;)