DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
generateVoxelComplexTables.cpp
Go to the documentation of this file.
1
16
44
46
#include <iostream>
47
#include <vector>
48
#include "DGtal/helpers/StdDefs.h"
49
#include "DGtal/topology/VoxelComplexFunctions.h"
50
#include "DGtal/topology/tables/NeighborhoodTablesGenerators.h"
51
53
54
using namespace
std
;
55
using namespace
DGtal
;
56
58
59
60
61
int
main
(
int
argc,
char
** argv )
62
{
63
typedef
std::bitset<67108864>
ConfigMap
;
// 2^26
64
65
using namespace
Z3i
;
66
using
VoxelComplex
=
VoxelComplex<KSpace>
;
67
68
std::function< bool(
69
const
VoxelComplex
& ,
70
const
typename
VoxelComplex::Cell
& )
71
> skelFunction;
72
string
error_message(
73
"Provide one of the following arguments for select function:\n"
74
"- skelIsthmus \n"
75
"- oneIsthmus \n"
76
"- twoIsthmus \n"
);
77
if
(argc != 2 ){
78
cout << error_message << std::endl;
79
return
1;
80
}
81
std::string input_str = std::string(argv[1]);
82
if
(input_str ==
"skelIsthmus"
)
83
skelFunction =
functions::skelIsthmus<VoxelComplex>
;
84
else
if
(input_str ==
"oneIsthmus"
)
85
skelFunction =
functions::oneIsthmus<VoxelComplex>
;
86
else
if
(input_str ==
"twoIsthmus"
)
87
skelFunction =
functions::twoIsthmus<VoxelComplex>
;
88
else
{
89
cout << error_message << endl;
90
return
1;
91
}
92
93
trace
.
beginBlock
(
"Generate "
+ input_str +
" table for 26_6 topology"
);
94
// Too big for stack. Use heap instead.
95
auto
table26_6 = make_shared<ConfigMap>();
96
functions::generateVoxelComplexTable< VoxelComplex >
(
97
*table26_6,
98
skelFunction );
99
100
string
filename = input_str +
"_table26_6.txt"
;
101
trace
.
info
() <<
"Save to file... "
+ filename << std::endl;
102
ofstream file26_6( filename );
103
file26_6 << *table26_6;
104
file26_6.close();
105
106
trace
.
endBlock
();
107
108
return
0;
109
}
110
// //
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
DGtal::VoxelComplex
This class represents a voxel complex living in some Khalimsky space. Voxel complexes are derived fro...
Definition
VoxelComplex.h:91
DGtal::VoxelComplex::Cell
typename KSpace::Cell Cell
Definition
VoxelComplex.h:114
ConfigMap
std::vector< bool > ConfigMap
Definition
fullConvexityLUT2D.cpp:76
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal::functions::skelIsthmus
bool skelIsthmus(const TComplex &vc, const typename TComplex::Cell &cell)
DGtal::functions::generateVoxelComplexTable
void generateVoxelComplexTable(TMap &map, std::function< bool(const TVoxelComplex &, const typename TVoxelComplex::Cell &) > skelFunction)
Definition
NeighborhoodTablesGenerators.h:132
DGtal::functions::twoIsthmus
bool twoIsthmus(const TComplex &vc, const typename TComplex::Cell &cell)
DGtal::functions::oneIsthmus
bool oneIsthmus(const TComplex &vc, const typename TComplex::Cell &cell)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
topology
generateVoxelComplexTables.cpp
Generated on
for DGtal by
1.18.0