DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
parallelIIShortcuts.cpp
Go to the documentation of this file.
1
16
28
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
41
42
using namespace
DGtal
;
43
44
// Using standard 3D digital space.
45
typedef
Shortcuts<Z3i::KSpace>
SH3;
46
typedef
ShortcutsGeometry<Z3i::KSpace>
SHG3
;
48
49
int
main
()
50
{
51
53
auto
params =
SH3::defaultParameters
() |
SHG3::defaultParameters
();
54
params(
"polynomial"
,
"goursat"
)(
"gridstep"
, 0.125 );
55
auto
implicit_shape =
SH3::makeImplicitShape3D
( params );
56
auto
digitized_shape =
SH3::makeDigitizedImplicitShape3D
( implicit_shape, params );
57
auto
K
=
SH3::getKSpace
( params );
58
auto
surface
=
SH3::makeDigitalSurface
( digitized_shape,
K
, params );
59
auto
surfels =
SH3::getSurfelRange
(
surface
, params );
61
63
trace
.
info
()<<
"Input vol domain: "
<< digitized_shape->getDomain() << std::endl;
64
//Sequential
65
trace
.
beginBlock
(
"Single thread"
);
66
auto
curv =
SHG3::getIIMeanCurvatures
( digitized_shape, surfels, params );
67
trace
.
endBlock
();
68
69
//Parallel
70
trace
.
beginBlock
(
"4 threads on default axis"
);
71
auto
curv_par4 =
SHG3::getIIMeanCurvatures
( digitized_shape, surfels,
72
params(
"ii-thread-number"
, 4 ));
73
trace
.
endBlock
();
74
75
//Parallel
76
trace
.
beginBlock
(
"8 threads on axis 0"
);
77
auto
curv_par8_0 =
SHG3::getIIMeanCurvatures
( digitized_shape, surfels,
78
params(
"ii-thread-number"
, 8 )
79
(
"ii-split-axis"
, 0 ) );
80
trace
.
endBlock
();
81
82
//Parallel
83
trace
.
beginBlock
(
"8 threads on axis 1"
);
84
auto
curv_par8_1 =
SHG3::getIIMeanCurvatures
( digitized_shape, surfels,
85
params(
"ii-thread-number"
, 8 )
86
(
"ii-split-axis"
, 1 ) );
87
trace
.
endBlock
();
88
89
//Parallel
90
trace
.
beginBlock
(
"8 threads on axis 2"
);
91
auto
curv_par8_2 =
SHG3::getIIMeanCurvatures
( digitized_shape, surfels,
92
params(
"ii-thread-number"
, 8 )
93
(
"ii-split-axis"
, 2 ) );
94
trace
.
endBlock
();
95
96
//Parallel
97
trace
.
beginBlock
(
"16 threads on axis 2"
);
98
auto
curv_par16 =
SHG3::getIIMeanCurvatures
( digitized_shape, surfels,
99
params(
"ii-thread-number"
, 16 )
100
(
"ii-split-axis"
, 2 ) );
101
trace
.
endBlock
();
103
104
return
0;
105
}
106
// //
DGtal::ShortcutsGeometry
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
Definition
ShortcutsGeometry.h:83
DGtal::ShortcutsGeometry< Z3i::KSpace >::getIIMeanCurvatures
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
Definition
ShortcutsGeometry.h:1384
DGtal::ShortcutsGeometry< Z3i::KSpace >::defaultParameters
static Parameters defaultParameters()
Definition
ShortcutsGeometry.h:219
DGtal::Shortcuts
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
Definition
Shortcuts.h:102
DGtal::Shortcuts< Z3i::KSpace >::getKSpace
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition
Shortcuts.h:329
DGtal::Shortcuts< Z3i::KSpace >::makeDigitizedImplicitShape3D
static CountedPtr< DigitizedImplicitShape3D > makeDigitizedImplicitShape3D(CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
Definition
Shortcuts.h:520
DGtal::Shortcuts< Z3i::KSpace >::getSurfelRange
static SurfelRange getSurfelRange(CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters ¶ms=parametersDigitalSurface())
Definition
Shortcuts.h:1808
DGtal::Shortcuts< Z3i::KSpace >::makeDigitalSurface
static CountedPtr< DigitalSurface > makeDigitalSurface(CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters ¶ms=parametersDigitalSurface())
Definition
Shortcuts.h:1470
DGtal::Shortcuts< Z3i::KSpace >::defaultParameters
static Parameters defaultParameters()
Definition
Shortcuts.h:200
DGtal::Shortcuts< Z3i::KSpace >::makeImplicitShape3D
static CountedPtr< ImplicitShape3D > makeImplicitShape3D(const Parameters ¶ms=parametersImplicitShape3D())
Definition
Shortcuts.h:279
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
surface
CountedPtr< SH3::DigitalSurface > surface
Definition
dgtalCalculus-geodesic.cpp:66
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
K
KSpace K
Definition
testCubicalComplex.cpp:62
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
SHG3
ShortcutsGeometry< Z3i::KSpace > SHG3
Definition
testIntegralInvariantShortcuts.cpp:47
examples
geometry
surfaces
parallelIIShortcuts.cpp
Generated on
for DGtal by
1.18.0