-
Notifications
You must be signed in to change notification settings - Fork 0
/
HDF52vol_8cpp_source.html
155 lines (153 loc) · 14.1 KB
/
HDF52vol_8cpp_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!-- HTML header for doxygen 1.8.11-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<title>DGtalTools: HDF52vol.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="modern-doxygen-green.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">DGtalTools
 <span id="projectnumber">1.5.beta</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_b57b96a35df2152eae545f4f1611ca36.html">converters</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">HDF52vol.cpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>  </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <iostream></span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <DGtal/base/Common.h></span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <DGtal/io/readers/HDF5Reader.h></span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <DGtal/io/writers/VolWriter.h></span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <DGtal/helpers/StdDefs.h></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <DGtal/images/Image.h></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include <DGtal/images/ImageContainerBySTLVector.h></span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "CLI11.hpp"</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">using namespace </span><a class="code" href="namespaceDGtal.html">DGtal</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">using namespace </span>Z3i;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">void</span> missingParam ( std::string param )</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> {</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a604c07ec391ad12a1f3fb6479993f112">trace</a>.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Trace.html#a1e786a1f3b1047e92b73c82f67e3c295">error</a>() <<<span class="stringliteral">" Parameter: "</span><<param<<<span class="stringliteral">" is required.."</span>;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a604c07ec391ad12a1f3fb6479993f112">trace</a>.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Trace.html#ad054990834d2763627166540087a2980">info</a>() <<std::endl;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  exit ( 1 );</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> }</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  </div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="keywordtype">int</span> <a class="code" href="3dHeightMapViewer_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>**argv)</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// parse command line using CLI ----------------------------------------------</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  CLI::App app;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  std::string inputFileName;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  std::string outputFileName {<span class="stringliteral">"result.vol"</span>};</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  app.description(<span class="stringliteral">"Convert a 3D 8-bit HDF5 file to vol."</span>);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  app.add_option(<span class="stringliteral">"-i,--input,1"</span>, inputFileName, <span class="stringliteral">"Input HDF5 file."</span> )</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  ->required()</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  ->check(CLI::ExistingFile);</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  app.add_option(<span class="stringliteral">"-o,--output,2"</span>, outputFileName, <span class="stringliteral">"Output vol filename."</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  </div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  app.get_formatter()->column_width(40);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  CLI11_PARSE(app, argc, argv);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="comment">// END parse command line using CLI ----------------------------------------------</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keyword">typedef</span> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1ImageContainerBySTLVector.html">ImageContainerBySTLVector<Z3i::Domain, unsigned char></a> MyImageC;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  </div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  MyImageC imageC = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1HDF5Reader.html">HDF5Reader< MyImageC >::importHDF5_3D</a>( inputFileName, <span class="stringliteral">"/UInt8Array3D"</span> );</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordtype">bool</span> res = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1VolWriter.html">VolWriter< MyImageC>::exportVol</a>(outputFileName, imageC);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">if</span> (res)</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">else</span> </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  {</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a604c07ec391ad12a1f3fb6479993f112">trace</a>.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Trace.html#a1e786a1f3b1047e92b73c82f67e3c295">error</a>()<< <span class="stringliteral">"Error while exporting the volume."</span><<std::endl;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  }</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> }</div>
<div class="ttc" id="a3dHeightMapViewer_8cpp_html_a3c04138a5bfe5d72780bb7e82a18e627"><div class="ttname"><a href="3dHeightMapViewer_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a></div><div class="ttdeci">int main(int argc, char **argv)</div><div class="ttdef"><b>Definition:</b> <a href="3dHeightMapViewer_8cpp_source.html#l00206">3dHeightMapViewer.cpp:206</a></div></div>
<div class="ttc" id="aclassDGtal_1_1ImageContainerBySTLVector_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1ImageContainerBySTLVector.html">DGtal::ImageContainerBySTLVector</a></div></div>
<div class="ttc" id="aclassDGtal_1_1Trace_html_a1e786a1f3b1047e92b73c82f67e3c295"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Trace.html#a1e786a1f3b1047e92b73c82f67e3c295">DGtal::Trace::error</a></div><div class="ttdeci">std::ostream & error()</div></div>
<div class="ttc" id="aclassDGtal_1_1Trace_html_ad054990834d2763627166540087a2980"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Trace.html#ad054990834d2763627166540087a2980">DGtal::Trace::info</a></div><div class="ttdeci">std::ostream & info()</div></div>
<div class="ttc" id="anamespaceDGtal_html"><div class="ttname"><a href="namespaceDGtal.html">DGtal</a></div></div>
<div class="ttc" id="anamespaceDGtal_html_a604c07ec391ad12a1f3fb6479993f112"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a604c07ec391ad12a1f3fb6479993f112">DGtal::trace</a></div><div class="ttdeci">Trace trace(traceWriterTerm)</div></div>
<div class="ttc" id="astructDGtal_1_1HDF5Reader_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1HDF5Reader.html">DGtal::HDF5Reader</a></div></div>
<div class="ttc" id="astructDGtal_1_1VolWriter_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1VolWriter.html">DGtal::VolWriter</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.11-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Companion project associated to <a href= "http://liris.cnrs.fr/dgtal/doc/nightly/"> DGtal </a>;
Generated on Mon Aug 26 2024 21:31:31 for DGtalTools by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.9.1
</small></address>
</body>
</html>