DGtal 2.1.1
Loading...
Searching...
No Matches
parallelIIShortcuts.cpp
Go to the documentation of this file.
1
30#include <iostream>
31#include "ConfigExamples.h"
32
33// Helpers
34#include "DGtal/base/Common.h"
35#include "DGtal/helpers/StdDefs.h"
36
37#include "DGtal/helpers/Shortcuts.h"
38#include "DGtal/helpers/ShortcutsGeometry.h"
39
40
41// Visualization
42#include "DGtal/io/viewers/PolyscopeViewer.h"
43#include "DGtal/io/colormaps/GradientColorMap.h"
44
46
47using namespace DGtal;
48
49// Using standard 3D digital space.
53
54int main()
55{
56
59 params( "polynomial", "goursat" )( "gridstep", 0.125 );
60 auto implicit_shape = SH3::makeImplicitShape3D ( params );
61 auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
62 auto K = SH3::getKSpace( params );
63 auto surface = SH3::makeDigitalSurface( digitized_shape, K, params );
64 auto surfels = SH3::getSurfelRange( surface, params );
66
68 trace.info()<< "Input vol domain: "<< digitized_shape->getDomain() << std::endl;
69 //Sequential
70 trace.beginBlock("Single thread");
71 auto curv = SHG3::getIIMeanCurvatures( digitized_shape, surfels, params );
73
74 //Parallel
75 trace.beginBlock("4 threads on default axis");
76 auto curv_par4 = SHG3::getIIMeanCurvatures( digitized_shape, surfels,
77 params( "ii-thread-number", 4 ));
79
80 //Parallel
81 trace.beginBlock("8 threads on axis 0");
82 auto curv_par80 = SHG3::getIIMeanCurvatures( digitized_shape, surfels,
83 params( "ii-thread-number", 8 )
84 ( "ii-split-axis", 0 ) );
86
87 //Parallel
88 trace.beginBlock("8 threads on axis 1");
89 auto curv_par81 = SHG3::getIIMeanCurvatures( digitized_shape, surfels,
90 params( "ii-thread-number", 8 )
91 ( "ii-split-axis", 1 ) );
93
94 //Parallel
95 trace.beginBlock("8 threads on axis 2");
96 auto curv_par82 = SHG3::getIIMeanCurvatures( digitized_shape, surfels,
97 params( "ii-thread-number", 8 )
98 ( "ii-split-axis", 2 ) );
100
101 //Parallel
102 trace.beginBlock("16 threads on axis 2");
103 auto curv_par16 = SHG3::getIIMeanCurvatures( digitized_shape, surfels,
104 params( "ii-thread-number", 16 )
105 ( "ii-split-axis", 2 ) );
106 trace.endBlock();
108
109 return 0;
110}
111// //
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static Parameters defaultParameters()
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
Definition Shortcuts.h:102
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition Shortcuts.h:329
static CountedPtr< DigitizedImplicitShape3D > makeDigitizedImplicitShape3D(CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
Definition Shortcuts.h:520
static SurfelRange getSurfelRange(CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersDigitalSurface())
Definition Shortcuts.h:1808
static CountedPtr< DigitalSurface > makeDigitalSurface(CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
Definition Shortcuts.h:1470
static Parameters defaultParameters()
Definition Shortcuts.h:200
static CountedPtr< ImplicitShape3D > makeImplicitShape3D(const Parameters &params=parametersImplicitShape3D())
Definition Shortcuts.h:279
void beginBlock(const std::string &keyword="")
std::ostream & info()
double endBlock()
CountedPtr< SH3::DigitalSurface > surface
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
Shortcuts< Z3i::KSpace > SH3
ShortcutsGeometry< Z3i::KSpace > SHG3
int main()
KSpace K