-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3dVolViewer_8cpp_source.html
404 lines (402 loc) · 60.3 KB
/
3dVolViewer_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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<!-- 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: 3dVolViewer.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_74fcefaf575a6d4264bd59dd648a438b.html">visualisation</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">3dVolViewer.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>  </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "DGtal/base/Common.h"</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "DGtal/base/BasicFunctors.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/io/readers/GenericReader.h"</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "DGtal/io/viewers/Viewer3D.h"</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include "DGtal/io/DrawWithDisplay3DModifier.h"</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "DGtal/io/readers/PointListReader.h"</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include "DGtal/io/readers/MeshReader.h"</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="preprocessor">#include "DGtal/io/Color.h"</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#include "DGtal/io/colormaps/GradientColorMap.h"</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#include "DGtal/images/ImageSelector.h"</span></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> <span class="preprocessor">#include "CLI11.hpp"</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">using namespace </span><a class="code" href="namespaceDGtal.html">DGtal</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">using namespace </span>Z3i;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="keyword">template</span> < <span class="keyword">typename</span> Space = DGtal::Z3i::Space, <span class="keyword">typename</span> KSpace = DGtal::Z3i::KSpace></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="keyword">struct </span>ViewerSnap: <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1Viewer3D_1_1CompFarthestPolygonFromCamera.html">DGtal::Viewer3D</a> <Space, KSpace></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> {</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  ViewerSnap(<span class="keywordtype">bool</span> saveSnap): <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html">Viewer3D</a><<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1SpaceND.html">Space</a>, <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1KhalimskySpaceND.html">KSpace</a>>(), mySaveSnap(saveSnap){</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  };</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  init(){</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html#ab52056b932170ead92ac0567d4649320">DGtal::Viewer3D<>::init</a>();</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordflow">if</span>(mySaveSnap){</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  QObject::connect(<span class="keyword">this</span>, SIGNAL(drawFinished(<span class="keywordtype">bool</span>)), <span class="keyword">this</span>, SLOT(saveSnapshot(<span class="keywordtype">bool</span>)));</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  }</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  };</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordtype">bool</span> mySaveSnap;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> };</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  </div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="keyword">typedef</span> ViewerSnap<> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html">Viewer</a>;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  </div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// call back function to display voxel coordinates</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">template</span><<span class="keyword">typename</span> TImage></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="keywordtype">int</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> displayCoordsCallBack( <span class="keywordtype">void</span>* viewer, <span class="keywordtype">int</span> name, <span class="keywordtype">void</span>* data )</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> {</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  TImage *image = (TImage *) data;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  std::stringstream ss;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1PointVector.html">Z3i::Point</a> p = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1Linearizer.html">DGtal::Linearizer<typename TImage::Domain>::getPoint</a>(name, image->domain());</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="comment">// Check needed since simetimes the point appears outside (only in non debug mode). </span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">if</span> (image->domain().isInside(p)){</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  ss << <span class="stringliteral">"Selected intensity: "</span> << (*image)(p) << <span class="stringliteral">"p "</span> << p[0] << <span class="stringliteral">" "</span><< p[1] << <span class="stringliteral">" "</span> << p[2] ;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  ((<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html">Viewer</a> *) viewer)->displayMessage(QString(ss.str().c_str()), 100000);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  }</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> }</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  </div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="keyword">template</span> <<span class="keyword">typename</span> TImage></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> processDisplay(ViewerSnap<> &viewer, TImage &image,</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keyword">const</span> <span class="keyword">typename</span> TImage::Value &thresholdMin,</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keyword">const</span> <span class="keyword">typename</span> TImage::Value &thresholdMax,</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numDisplayedMax,</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> transparency,</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordtype">bool</span> useTransIntensity=<span class="keyword">false</span>,</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordtype">bool</span> interDisplay=<span class="keyword">false</span>,</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordtype">bool</span> squaredTransp=<span class="keyword">false</span>)</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> {</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1IteratorCompletionTraits_3_01ArrayImageAdapter_3_01TArrayIterator_00_01TDomain_01_4_01_4_1_1DistanceFunctor.html#a79a0f67cc951326052b97eeea300e2c1">Domain</a> domain = image.domain();</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1GradientColorMap.html">GradientColorMap<typename TImage::Value></a> gradient( thresholdMin, thresholdMax);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numDisplayed = 0;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  gradient.addColor(Color::Blue);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  gradient.addColor(Color::Green);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  gradient.addColor(Color::Yellow);</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  gradient.addColor(Color::Red);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">typename</span> TImage::Value varInt = 0;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">if</span> (useTransIntensity){</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  varInt = thresholdMax-thresholdMin;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  }</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">for</span>(<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1HyperRectDomain__Iterator.html">Domain::ConstIterator</a> it = domain.begin(), itend=domain.end(); it!=itend; ++it){</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keywordtype">double</span> trInt = 1.0;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keywordflow">if</span> (useTransIntensity){</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  trInt = ((float)(image( (*it) )-thresholdMin)/(<span class="keywordtype">float</span>)varInt);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  }</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keyword">typename</span> TImage::Value val= image( (*it) );</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordflow">if</span>(numDisplayed > numDisplayedMax)</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  </div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html">Color</a> c= gradient(val);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span>(val<=thresholdMax && val >=thresholdMin)</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  {</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  </div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  viewer << <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1CustomColors3D.html">CustomColors3D</a>(<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html">Color</a>(c.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#aa487b3d008dc44964b10971ce8a26432">red</a>(), c.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#a5917f9d174eb75eae2ce49e7f40edbb7">green</a>(),c.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#af51469f44cfc0603c66efe150b1b0c33">blue</a>(),</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keyword">static_cast<</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">></span>(transparency*trInt*(squaredTransp? trInt : 1.0))),</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html">Color</a>(c.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#aa487b3d008dc44964b10971ce8a26432">red</a>(), c.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#a5917f9d174eb75eae2ce49e7f40edbb7">green</a>(),c.<a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#af51469f44cfc0603c66efe150b1b0c33">blue</a>(),</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keyword">static_cast<</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">></span>(transparency*trInt*(squaredTransp? trInt: 1.0))));</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordflow">if</span> (interDisplay)</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  {</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keyword">auto</span> p = *it;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keyword">auto</span> index = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1Linearizer.html">DGtal::Linearizer<typename TImage::Domain>::getIndex</a>( p, domain);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  viewer << <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1SetName3D.html">SetName3D</a>( index ) ;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  }</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  viewer << *it;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  numDisplayed++;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  }</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  }</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">if</span> (interDisplay){</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  viewer << <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1SetSelectCallback3D.html">SetSelectCallback3D</a>(displayCoordsCallBack<TImage>,</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  &image );</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  }</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span> }</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  </div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  </div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  </div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  </div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</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="l00201"></a><span class="lineno"> 201</span> {</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment">// parse command line using CLI ----------------------------------------------</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  CLI::App app;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  app.description(<span class="stringliteral">"Display volume file as a voxel set by using QGLviewer. \n Example: \n \t 3dVolViewer $DGtal/examples/samples/lobster.vol -m 60 -t 10"</span>);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  std::string inputFileName;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a1c09e3f63904ff371f1b99f45069fc63">DGtal::int64_t</a> rescaleInputMin {0};</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a1c09e3f63904ff371f1b99f45069fc63">DGtal::int64_t</a> rescaleInputMax {255};</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordtype">double</span> thresholdMin {0};</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordtype">double</span> thresholdMax {255};</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> transparency {255};</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numDisplayedMax {500000};</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  std::string displayMesh;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  std::string snapShotFile;</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  std::vector<unsigned int> colorMesh;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  std::vector<unsigned int > customBGColor;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  </div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordtype">string</span> inputType {<span class="stringliteral">""</span>};</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordtype">bool</span> interactiveDisplayVoxCoords {<span class="keyword">false</span>};</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordtype">bool</span> transIntensity {<span class="keyword">false</span>};</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordtype">bool</span> transIntensitySq {<span class="keyword">false</span>};</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordtype">bool</span> useLastCamSet {<span class="keyword">false</span>};</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  </div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  app.add_option(<span class="stringliteral">"-i,--input,1"</span>, inputFileName, <span class="stringliteral">"vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255."</span> )</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  ->required()</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  ->check(CLI::ExistingFile);</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> <span class="preprocessor">#ifdef WITH_ITK</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  app.add_option(<span class="stringliteral">"--inputType"</span>, inputType, <span class="stringliteral">"to specify the input image type (int or double)."</span>)</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  -> check(CLI::IsMember({<span class="stringliteral">"int"</span>, <span class="stringliteral">"double"</span>}));</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span> <span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  app.add_option(<span class="stringliteral">"--thresholdMin,-m"</span>, thresholdMin, <span class="stringliteral">"threshold min (excluded) to define binary shape."</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  app.add_option(<span class="stringliteral">"--thresholdMax,-M"</span>, thresholdMax, <span class="stringliteral">"threshold max (included) to define binary shape."</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  app.add_option(<span class="stringliteral">"--rescaleInputMin"</span>, rescaleInputMin, <span class="stringliteral">"min value used to rescale the input intensity (to avoid basic cast into 8 bits image)."</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  app.add_option(<span class="stringliteral">"--rescaleInputMax"</span>, rescaleInputMax, <span class="stringliteral">"max value used to rescale the input intensity (to avoid basic cast into 8 bits image)."</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  app.add_option(<span class="stringliteral">"--numMaxVoxel,-n"</span>, numDisplayedMax, <span class="stringliteral">"set the maximal voxel number to be displayed."</span>);</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  app.add_option(<span class="stringliteral">"--displayMesh"</span>, displayMesh, <span class="stringliteral">"display a Mesh given in OFF or OFS format."</span>);</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  app.add_option(<span class="stringliteral">"--colorMesh"</span>, colorMesh, <span class="stringliteral">"set the color of Mesh (given from displayMesh option) : r g b a "</span>)</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  ->expected(4);</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  app.add_option(<span class="stringliteral">"--doSnapShotAndExit,-d"</span>, snapShotFile, <span class="stringliteral">"save display snapshot into file. Notes that the camera setting is set by default according the last saved configuration (use SHIFT+Key_M to save current camera setting in the Viewer3D). If the camera setting was not saved it will use the default camera setting."</span>);</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  app.add_option(<span class="stringliteral">"--customBGColor,-b"</span>, customBGColor, <span class="stringliteral">"set the R, G, B, A components of the colors of the sdp view"</span>)</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  ->expected(3);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  app.add_option(<span class="stringliteral">"--transparency,-t"</span>, transparency, <span class="stringliteral">"change the defaukt transparency"</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  app.add_flag(<span class="stringliteral">"--transIntensity"</span>,transIntensity , <span class="stringliteral">"Used vocel intensity to define transparency valeue"</span>);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  app.add_flag(<span class="stringliteral">"--transIntensitySq"</span>,transIntensitySq , <span class="stringliteral">"Used squared vocel intensity to define transparency valeue"</span>);</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  app.add_flag(<span class="stringliteral">"--interactiveDisplayVoxCoords,-c"</span>, interactiveDisplayVoxCoords, <span class="stringliteral">" by using this option the coordinates can be displayed after selection (shift+left click on voxel)."</span>);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  app.add_flag(<span class="stringliteral">"--useLastCameraSetting"</span>, useLastCamSet, <span class="stringliteral">"use the last camera setting of the user (i.e if a .qglviewer.xml file is present in the current directory)"</span>);</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  app.get_formatter()->column_width(40);</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  CLI11_PARSE(app, argc, argv);</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="comment">// END parse command line using CLI ----------------------------------------------</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  </div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  QApplication application(argc,argv);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html">Viewer</a> viewer(snapShotFile != <span class="stringliteral">""</span>);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keywordflow">if</span>(snapShotFile != <span class="stringliteral">""</span>){</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  viewer.setSnapshotFileName(QString(snapShotFile.c_str()));</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  }</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  viewer.setWindowTitle(<span class="stringliteral">"simple Volume Viewer"</span>);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  viewer.show();</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keyword">typedef</span> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1ImageContainerBySTLVector.html">ImageContainerBySTLVector < Z3i::Domain, double ></a> Image3D_D;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keyword">typedef</span> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1ImageContainerBySTLVector.html">ImageContainerBySTLVector < Z3i::Domain, int ></a> Image3D_I;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keyword">typedef</span> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1ImageSelector.html">ImageSelector<Domain, unsigned char>::Type</a> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Image.html">Image</a>;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  </div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keywordtype">string</span> extension = inputFileName.substr(inputFileName.find_last_of(<span class="stringliteral">"."</span>) + 1);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  </div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  std::vector<double> vectValD;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  std::vector<int> vectValI;</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  std::vector<unsigned char> vectValUC;</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="comment">// Image of different types are pre constructed here else it will be deleted after the type selection</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="comment">// (and it is used in display callback)</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1HyperRectDomain.html">Z3i::Domain</a> d;</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  Image3D_D imageD = Image3D_D(d);</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  Image3D_I imageI = Image3D_I(d);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Image.html">Image</a> image = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Image.html">Image</a>(d);</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">if</span> (customBGColor.size() == 3)</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  {</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  viewer.myDefaultBackgroundColor = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html">DGtal::Color</a>(customBGColor[0],</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  customBGColor[1],</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  customBGColor[2], 255);</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  viewer.update();</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  viewer.draw();</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  }</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">if</span>(extension != <span class="stringliteral">"sdp"</span>)</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  {</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numDisplayed=0;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  </div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span> <span class="preprocessor">#ifdef WITH_ITK</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordflow">if</span> (inputType==<span class="stringliteral">"double"</span>)</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  {</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  imageD = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1GenericReader.html#a7e2fbfbe0d3c94e6bc4ca67e96c01f7c">DGtal::GenericReader<Image3D_D>::import</a>(inputFileName);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</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>() << <span class="stringliteral">"[done]"</span><< std::endl;</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</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>() << <span class="stringliteral">"Image loaded: D "</span><<imageD<< std::endl;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  processDisplay(viewer, imageD, thresholdMin, thresholdMax, numDisplayedMax, transparency,</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  transIntensity||transIntensitySq, interactiveDisplayVoxCoords, transIntensitySq);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  }</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (inputType==<span class="stringliteral">"int"</span>)</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  {</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  imageI= <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1GenericReader.html#a7e2fbfbe0d3c94e6bc4ca67e96c01f7c">DGtal::GenericReader<Image3D_I>::import</a>(inputFileName);</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</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>() << <span class="stringliteral">"Image loaded: "</span><<image<< std::endl;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  processDisplay(viewer, imageI, (<span class="keywordtype">int</span>)thresholdMin, (<span class="keywordtype">int</span>)thresholdMax, numDisplayedMax, transparency,</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  transIntensity||transIntensitySq, interactiveDisplayVoxCoords, transIntensitySq);</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keyword">typedef</span> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1functors_1_1Rescaling.html">DGtal::functors::Rescaling<DGtal::int64_t ,unsigned char ></a> RescalFCT;</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  image = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1GenericReader.html">GenericReader< Image >::importWithValueFunctor</a>( inputFileName,RescalFCT(rescaleInputMin,</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  rescaleInputMax,</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  0, 255) );</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</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>() << <span class="stringliteral">"Image loaded: "</span><<image<< std::endl;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  processDisplay(viewer, image, thresholdMin, thresholdMax, numDisplayedMax, transparency,</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  transIntensity||transIntensitySq, interactiveDisplayVoxCoords, transIntensitySq);</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  }</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keyword">typedef</span> <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1functors_1_1Rescaling.html">DGtal::functors::Rescaling<DGtal::int64_t ,unsigned char ></a> RescalFCT;</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  image = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1GenericReader.html">GenericReader< Image >::importWithValueFunctor</a>( inputFileName,RescalFCT(rescaleInputMin,</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  rescaleInputMax,</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  0, 255) );</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</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>() << <span class="stringliteral">"Image loaded: "</span><<image<< std::endl;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  processDisplay(viewer, image, thresholdMin, thresholdMax, numDisplayedMax, transparency,</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  transIntensity||transIntensitySq, interactiveDisplayVoxCoords, transIntensitySq);</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  }</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(extension==<span class="stringliteral">"sdp"</span>)</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  {</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  vector<Z3i::RealPoint> vectVoxels = <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1PointListReader.html">PointListReader<Z3i::RealPoint>::getPointsFromFile</a>(inputFileName);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0;i< vectVoxels.size(); i++){</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  viewer << <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1PointVector.html">Z3i::Point</a>(vectVoxels.at(i), functors::Round<>());</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  }</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  }</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keywordflow">if</span>(displayMesh != <span class="stringliteral">""</span>)</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  {</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordflow">if</span>(colorMesh.size() != 0)</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  {</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html">Color</a> c(colorMesh[0], colorMesh[1], colorMesh[2], colorMesh[3]);</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  viewer.setFillColor(c);</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  }</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  </div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Mesh.html">DGtal::Mesh<Z3i::RealPoint></a> aMesh(colorMesh.size() == 0);</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1MeshReader.html">MeshReader<Z3i::RealPoint>::importOFFFile</a>(displayMesh, aMesh);</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  viewer << aMesh;</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  }</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  </div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  viewer << Viewer3D<>::updateDisplay;</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <span class="keywordflow">if</span>(snapShotFile != <span class="stringliteral">""</span> )</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  {</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <span class="comment">// Recover mesh position</span></div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  viewer.restoreStateFromFile();</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  viewer.saveSnapshot(QString(snapShotFile.c_str()), <span class="keyword">true</span>);</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  }</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  </div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">if</span> (useLastCamSet)</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  {</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  viewer.restoreStateFromFile();</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  }</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="comment">// First display transparency improve</span></div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  viewer.sortTriangleFromCamera();</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  viewer.sortQuadFromCamera();</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  viewer.sortSurfelFromCamera();</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  viewer.sortPolygonFromCamera();</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  viewer << <a class="codeRef" href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Display3D.html#a96b45e0a0c762c14c0e5e27045d1ca04a96910329360ab83c484f03e0fff1cb45">Viewer::updateDisplay</a>;</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</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>() << <span class="stringliteral">"[display ready]"</span><< std::endl;</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keywordflow">return</span> application.exec();</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</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_1Color_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html">DGtal::Color</a></div></div>
<div class="ttc" id="aclassDGtal_1_1Color_html_a5917f9d174eb75eae2ce49e7f40edbb7"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#a5917f9d174eb75eae2ce49e7f40edbb7">DGtal::Color::green</a></div><div class="ttdeci">void green(const unsigned char aGreenValue)</div></div>
<div class="ttc" id="aclassDGtal_1_1Color_html_aa487b3d008dc44964b10971ce8a26432"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#aa487b3d008dc44964b10971ce8a26432">DGtal::Color::red</a></div><div class="ttdeci">void red(const unsigned char aRedValue)</div></div>
<div class="ttc" id="aclassDGtal_1_1Color_html_af51469f44cfc0603c66efe150b1b0c33"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Color.html#af51469f44cfc0603c66efe150b1b0c33">DGtal::Color::blue</a></div><div class="ttdeci">void blue(const unsigned char aBlueValue)</div></div>
<div class="ttc" id="aclassDGtal_1_1Display3D_html_a96b45e0a0c762c14c0e5e27045d1ca04a96910329360ab83c484f03e0fff1cb45"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Display3D.html#a96b45e0a0c762c14c0e5e27045d1ca04a96910329360ab83c484f03e0fff1cb45">DGtal::Display3D::updateDisplay</a></div><div class="ttdeci">updateDisplay</div></div>
<div class="ttc" id="aclassDGtal_1_1GradientColorMap_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1GradientColorMap.html">DGtal::GradientColorMap</a></div></div>
<div class="ttc" id="aclassDGtal_1_1HyperRectDomain__Iterator_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1HyperRectDomain__Iterator.html">DGtal::HyperRectDomain_Iterator</a></div></div>
<div class="ttc" id="aclassDGtal_1_1HyperRectDomain_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1HyperRectDomain.html">HyperRectDomain< Space ></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_1Image_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Image.html">DGtal::Image</a></div></div>
<div class="ttc" id="aclassDGtal_1_1IteratorCompletionTraits_3_01ArrayImageAdapter_3_01TArrayIterator_00_01TDomain_01_4_01_4_1_1DistanceFunctor_html_a79a0f67cc951326052b97eeea300e2c1"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1IteratorCompletionTraits_3_01ArrayImageAdapter_3_01TArrayIterator_00_01TDomain_01_4_01_4_1_1DistanceFunctor.html#a79a0f67cc951326052b97eeea300e2c1">Domain</a></div><div class="ttdeci">typename Self::Domain Domain</div></div>
<div class="ttc" id="aclassDGtal_1_1KhalimskySpaceND_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1KhalimskySpaceND.html">DGtal::KhalimskySpaceND</a></div></div>
<div class="ttc" id="aclassDGtal_1_1Mesh_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Mesh.html">DGtal::Mesh</a></div></div>
<div class="ttc" id="aclassDGtal_1_1PointVector_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1PointVector.html">PointVector< dim, Integer ></a></div></div>
<div class="ttc" id="aclassDGtal_1_1SpaceND_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1SpaceND.html">DGtal::SpaceND</a></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="aclassDGtal_1_1Viewer3D_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html">DGtal::Viewer3D</a></div></div>
<div class="ttc" id="aclassDGtal_1_1Viewer3D_html_ab52056b932170ead92ac0567d4649320"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/classDGtal_1_1Viewer3D.html#ab52056b932170ead92ac0567d4649320">DGtal::Viewer3D::init</a></div><div class="ttdeci">virtual void init()</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_a1c09e3f63904ff371f1b99f45069fc63"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/namespaceDGtal.html#a1c09e3f63904ff371f1b99f45069fc63">DGtal::int64_t</a></div><div class="ttdeci">boost::int64_t int64_t</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_1CustomColors3D_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1CustomColors3D.html">DGtal::CustomColors3D</a></div></div>
<div class="ttc" id="astructDGtal_1_1GenericReader_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1GenericReader.html">DGtal::GenericReader</a></div></div>
<div class="ttc" id="astructDGtal_1_1GenericReader_html_a7e2fbfbe0d3c94e6bc4ca67e96c01f7c"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1GenericReader.html#a7e2fbfbe0d3c94e6bc4ca67e96c01f7c">DGtal::GenericReader::import</a></div><div class="ttdeci">static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())</div></div>
<div class="ttc" id="astructDGtal_1_1ImageSelector_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1ImageSelector.html">DGtal::ImageSelector</a></div></div>
<div class="ttc" id="astructDGtal_1_1Linearizer_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1Linearizer.html">DGtal::Linearizer</a></div></div>
<div class="ttc" id="astructDGtal_1_1MeshReader_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1MeshReader.html">DGtal::MeshReader</a></div></div>
<div class="ttc" id="astructDGtal_1_1PointListReader_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1PointListReader.html">DGtal::PointListReader</a></div></div>
<div class="ttc" id="astructDGtal_1_1SetName3D_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1SetName3D.html">DGtal::SetName3D</a></div></div>
<div class="ttc" id="astructDGtal_1_1SetSelectCallback3D_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1SetSelectCallback3D.html">DGtal::SetSelectCallback3D</a></div></div>
<div class="ttc" id="astructDGtal_1_1Viewer3D_1_1CompFarthestPolygonFromCamera_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1Viewer3D_1_1CompFarthestPolygonFromCamera.html">DGtal::Viewer3D</a></div></div>
<div class="ttc" id="astructDGtal_1_1functors_1_1Rescaling_html"><div class="ttname"><a href="https://dgtal-team.github.io/doc-nightly/structDGtal_1_1functors_1_1Rescaling.html">DGtal::functors::Rescaling</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 Dec 23 2024 09:51:48 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>