-
Notifications
You must be signed in to change notification settings - Fork 1
/
dip-Histogram.html
560 lines (556 loc) · 49.9 KB
/
dip-Histogram.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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>dip::Histogram class | DIPlib | a library for quantitative image analysis</title>
<link rel="stylesheet" href="m-dip+documentation.compiled.css" />
<link rel="icon" href="DIPlib_logo_32.png" type="image/png" />
<link rel="search" type="application/opensearchdescription+xml" href="opensearch.xml" title="Search DIPlib documentation" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#ffffff" />
</head>
<body>
<header><nav id="navigation">
<div class="m-container">
<div class="m-row">
<span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
<a href="https://diplib.org"><img src="DIPlib_logo.svg" alt="" />DIPlib</a><span class="m-breadcrumb">┃</span><a href="index.html" class="m-thin">a library for quantitative image analysis</a><span class="m-breadcrumb">┃</span><a href="https://github.com/DIPlib/diplib/releases/tag/3.5.1" class="m-thin">version 3.5.1</a> </span>
<div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
<a href="#search" class="m-doc-search-icon" title="Search" onclick="return showSearch()"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
<path id="m-doc-search-icon-path" d="m6 0c-3.31 0-6 2.69-6 6 0 3.31 2.69 6 6 6 1.49 0 2.85-0.541 3.89-1.44-0.0164 0.338 0.147 0.759 0.5 1.15l3.22 3.79c0.552 0.614 1.45 0.665 2 0.115 0.55-0.55 0.499-1.45-0.115-2l-3.79-3.22c-0.392-0.353-0.812-0.515-1.15-0.5 0.895-1.05 1.44-2.41 1.44-3.89 0-3.31-2.69-6-6-6zm0 1.56a4.44 4.44 0 0 1 4.44 4.44 4.44 4.44 0 0 1-4.44 4.44 4.44 4.44 0 0 1-4.44-4.44 4.44 4.44 0 0 1 4.44-4.44z"/>
</svg></a>
<a id="m-navbar-show" href="#navigation" title="Show navigation"></a>
<a id="m-navbar-hide" href="#" title="Hide navigation"></a>
</div>
<div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
<div class="m-row">
<ol class="m-col-t-6 m-col-m-none">
<li><a href="pages.html">Pages</a></li>
<li><a href="modules.html">Modules</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="3">
<li><a href="classes.html">Classes</a></li>
<li><a href="files.html">Files</a></li>
<li class="m-show-m"><a href="#search" class="m-doc-search-icon" title="Search" onclick="return showSearch()"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
<use href="#m-doc-search-icon-path" />
</svg></a></li>
</ol>
</div>
</div>
</div>
</div>
</nav></header>
<main><article>
<div class="m-container m-container-inflatable">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<h1>
<div class="m-doc-include m-right-m m-text-right">
<span class="m-thin"><a href="histograms.html" class="m-doc">Histograms</a> module</span><br/><span class="m-code m-inverted"><span class="cp">#include</span> <a class="cpf" href="file--diplib--histogram-h.html">"diplib/histogram.h"</a></span> </div>
<span class="m-breadcrumb"><a href="dip.html">dip</a>::<wbr/></span>Histogram <span class="m-thin">class</span> </h1>
<p>Computes and holds histograms.</p>
<div class="m-block m-default">
<h3>Contents</h3>
<ul>
<li>
Reference
<ul>
<li><a href="#typeless-methods">Constructors, destructors, assignment and conversion operators</a></li>
<li><a href="#nested-classes">Classes</a></li>
<li><a href="#alias-members">Aliases</a></li>
<li><a href="#function-members">Functions</a></li>
<li><a href="#operator-members">Operators</a></li>
<li><a href="#related">Related</a></li>
</ul>
</li>
</ul>
</div>
<p>A histogram is computed by the constructor. A default-constructed <code>Histogram</code> is empty and can
only be assigned to.</p>
<p>A histogram can have multiple dimensions. In general, a scalar image will yield a classical
one-dimensional histogram, and a tensor image will yield a multi-dimensional histogram, with
one dimension per tensor element. The first tensor element determines the index along the first
dimension, the second tensor element that along the second dimension, etc.</p>
<p>To facilitate usage for one-dimensional histograms, all getter functions that return a value
for a given dimension, default to dimension 0, so can be called without arguments.</p>
<section id="typeless-methods">
<h2>Constructors, destructors, assignment and conversion operators</h2>
<dl class="m-doc">
<dt>
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Image-CL-Image-CL-ConfigurationArray-" class="m-doc">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Image.html" class="m-doc">dip::Image</a> const& input,
<a href="dip-Image.html" class="m-doc">dip::Image</a> const& mask = {},
<a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration = {}) <span class="m-label m-flat m-info">explicit</span> </span>
</dt>
<dd>The constructor takes an image, an optional mask, and configuration options for each histogram
dimension.</dd>
<dt id="dip-Histogram-Histogram-Image-CL-Image-CL-Configuration-">
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Image-CL-Image-CL-Configuration-" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Image.html" class="m-doc">dip::Image</a> const& input,
<a href="dip-Image.html" class="m-doc">dip::Image</a> const& mask,
<a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a> configuration)</span>
</dt>
<dd>This version of the constructor is identical to the previous one, but with a single configuration
parameter instead of an array.</dd>
<dt id="dip-Histogram-Histogram-Image-CL-Image-CL-Image-CL-ConfigurationArray-">
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Image-CL-Image-CL-Image-CL-ConfigurationArray-" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Image.html" class="m-doc">dip::Image</a> const& input1,
<a href="dip-Image.html" class="m-doc">dip::Image</a> const& input2,
<a href="dip-Image.html" class="m-doc">dip::Image</a> const& mask,
<a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration = {})</span>
</dt>
<dd>A version of the constructor that takes two scalar input images, and constructs their joint histogram
(a 2D histogram, equal to the one obtained if the two images were the two channels of a tensor image).</dd>
<dt>
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Measurement-IteratorFeature-CL-ConfigurationArray-" class="m-doc">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Measurement-IteratorFeature.html" class="m-doc">dip::Measurement::IteratorFeature</a> const& featureValues,
<a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration = {}) <span class="m-label m-flat m-info">explicit</span> </span>
</dt>
<dd>The constructor takes an <code>IteratorFeature</code> of a <a href="dip-Measurement.html"><code>dip::Measurement</code></a> object, and configuration
options for each histogram dimension.</dd>
<dt>
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-ConfigurationArray-" class="m-doc">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration) <span class="m-label m-flat m-info">explicit</span> </span>
</dt>
<dd>An empty histogram with the given configuration. Histogram bins are initialized to 0.</dd>
<dt>
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Configuration-CL" class="m-doc">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a> const& configuration) <span class="m-label m-flat m-info">explicit</span> </span>
</dt>
<dd>An empty histogram with the given configuration. Histogram bins are initialized to 0.</dd>
<dt>
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-CountType-CP-Configuration-CL" class="m-doc">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a> const* data,
<a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a> const& configuration)</span>
</dt>
<dd>Create a 1D histogram around existing data. No ownership is transferred.</dd>
<dt id="dip-Histogram-Histogram">
<span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap">) <span class="m-label m-flat m-info">defaulted</span></span>
</dt>
<dd>The default-initialized histogram is empty and can only be assigned to.</dd>
</dl>
</section>
<section id="nested-classes">
<h2>Classes</h2>
<dl class="m-doc">
<dt>
struct <a href="dip-Histogram-Configuration.html" class="m-doc">Configuration</a>
</dt>
<dd>Configuration information for how the histogram is computed.</dd>
</dl>
</section>
<section id="alias-members">
<h2>Aliases</h2>
<dl class="m-doc">
<dt id="dip-Histogram-CountType">
using <a href="#dip-Histogram-CountType" class="m-doc-self">CountType</a> = <a href="pixeltypes.html#dip-uint64" class="m-doc">dip::uint64</a>
</dt>
<dd>Type of histogram bins. See <a href="dip-Histogram.html#dip-DT_COUNT"><code>dip::DT_COUNT</code></a>.</dd>
<dt id="dip-Histogram-ConfigurationArray">
using <a href="#dip-Histogram-ConfigurationArray" class="m-doc-self">ConfigurationArray</a> = <a href="dip-DimensionArray-T.html" class="m-doc">dip::DimensionArray</a>
</dt>
<dd>An array of <a href="dip-Histogram-Configuration.html"><code>dip::Histogram::Configuration</code></a> objects, one per histogram dimension.</dd>
</dl>
</section>
<section id="function-members">
<h2>Functions</h2>
<dl class="m-doc">
<dt>
<span class="m-doc-wrap-bumper">static auto <a href="#dip-Histogram-OptimalConfiguration" class="m-doc">OptimalConfiguration</a>(</span><span class="m-doc-wrap">) -> <a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a></span>
</dt>
<dd>Creates a <a href="dip-Histogram-Configuration.html"><code>dip::Histogram::Configuration</code></a> that uses the optimal bin size according to the Freedman–Diaconis rule.</dd>
<dt id="dip-Histogram-OptimalConfigurationWithFullRange">
<span class="m-doc-wrap-bumper">static auto <a href="#dip-Histogram-OptimalConfigurationWithFullRange" class="m-doc-self">OptimalConfigurationWithFullRange</a>(</span><span class="m-doc-wrap">) -> <a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a></span>
</dt>
<dd>Like <a href="dip-Histogram.html#dip-Histogram-OptimalConfiguration"><code>dip::Histogram::OptimalConfiguration</code></a>, but includes the full data range (min to max); note that this can
potentially lead to extremely large histograms.</dd>
<dt id="dip-Histogram-swap-Histogram-L">
<span class="m-doc-wrap-bumper">void <a href="#dip-Histogram-swap-Histogram-L" class="m-doc-self">swap</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>& other) <span class="m-label m-flat m-success">noexcept</span></span>
</dt>
<dd>Swaps <code>this</code> and <code>other</code>.</dd>
<dt id="dip-Histogram-IsInitialized-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-IsInitialized-C" class="m-doc-self">IsInitialized</a>(</span><span class="m-doc-wrap">) const -> bool</span>
</dt>
<dd>Returns false for a default-initialized histogram.</dd>
<dt>
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Copy-C" class="m-doc">Copy</a>(</span><span class="m-doc-wrap">) const -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a></span>
</dt>
<dd>Deep copy, returns a copy of <code>this</code> with its own data segment.</dd>
<dt>
<span class="m-doc-wrap-bumper">void <a href="#dip-Histogram-ReverseLookup-Image-CL-Image-L-BooleanArray-" class="m-doc">ReverseLookup</a>(</span><span class="m-doc-wrap"><a href="dip-Image.html" class="m-doc">dip::Image</a> const& input,
<a href="dip-Image.html" class="m-doc">dip::Image</a>& out,
<a href="supporttypes.html#dip-BooleanArray" class="m-doc">dip::BooleanArray</a> excludeOutOfBoundValues = {false})</span>
</dt>
<dd>Performs a reverse histogram lookup, yielding an image “painted” with the bin values.</dd>
<dt id="dip-Histogram-Dimensionality-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Dimensionality-C" class="m-doc-self">Dimensionality</a>(</span><span class="m-doc-wrap">) const -> <a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a></span>
</dt>
<dd>Returns the histogram dimensionality.</dd>
<dt id="dip-Histogram-Bins-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Bins-dip-uint--C" class="m-doc-self">Bins</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a></span>
</dt>
<dd>Returns the number of bins along dimension <code>dim</code></dd>
<dt id="dip-Histogram-BinSize-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-BinSize-dip-uint--C" class="m-doc-self">BinSize</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a></span>
</dt>
<dd>Returns the size of the bins along dimension <code>dim</code></dd>
<dt id="dip-Histogram-LowerBound-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-LowerBound-dip-uint--C" class="m-doc-self">LowerBound</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a></span>
</dt>
<dd>Returns the lower bound of the histogram for dimension <code>dim</code></dd>
<dt id="dip-Histogram-UpperBound-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-UpperBound-dip-uint--C" class="m-doc-self">UpperBound</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a></span>
</dt>
<dd>Returns the upper bound of the histogram for dimension <code>dim</code></dd>
<dt id="dip-Histogram-BinBoundaries-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-BinBoundaries-dip-uint--C" class="m-doc-self">BinBoundaries</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="supporttypes.html#dip-FloatArray" class="m-doc">dip::FloatArray</a></span>
</dt>
<dd>Returns the bin boundaries along dimension <code>dim</code> (<code>Bins(dim)+1</code> values).</dd>
<dt id="dip-Histogram-BinCenters-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-BinCenters-dip-uint--C" class="m-doc-self">BinCenters</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="supporttypes.html#dip-FloatArray" class="m-doc">dip::FloatArray</a></span>
</dt>
<dd>Returns the bin centers along dimension <code>dim</code></dd>
<dt id="dip-Histogram-BinCenter-dip-uint--dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-BinCenter-dip-uint--dip-uint--C" class="m-doc-self">BinCenter</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> bin,
<a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim = 0) const -> <a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a></span>
</dt>
<dd>Returns the bin center for the given <code>bin</code> along dimension <code>dim</code></dd>
<dt id="dip-Histogram-Bin-dfloat--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Bin-dfloat--C" class="m-doc-self">Bin</a>(</span><span class="m-doc-wrap"><a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a> value) const -> <a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a></span>
</dt>
<dd>Gets the bin for <code>value</code> in a 1D histogram</dd>
<dt id="dip-Histogram-Bin-dfloat--dfloat--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Bin-dfloat--dfloat--C" class="m-doc-self">Bin</a>(</span><span class="m-doc-wrap"><a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a> x_value,
<a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a> y_value) const -> <a href="supporttypes.html#dip-UnsignedArray" class="m-doc">dip::UnsignedArray</a></span>
</dt>
<dd>Gets the bin for {<code>x_value</code>, <code>y_value</code>} in a 2D histogram</dd>
<dt id="dip-Histogram-Bin-dfloat--dfloat--dfloat--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Bin-dfloat--dfloat--dfloat--C" class="m-doc-self">Bin</a>(</span><span class="m-doc-wrap"><a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a> x_value,
<a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a> y_value,
<a href="pixeltypes.html#dip-dfloat" class="m-doc">dip::dfloat</a> z_value) const -> <a href="supporttypes.html#dip-UnsignedArray" class="m-doc">dip::UnsignedArray</a></span>
</dt>
<dd>Gets the bin for {<code>x_value</code>, <code>y_value</code>, <code>z_value</code>} in a 3D histogram</dd>
<dt id="dip-Histogram-Bin-FloatArray-CL-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Bin-FloatArray-CL-C" class="m-doc-self">Bin</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-FloatArray" class="m-doc">dip::FloatArray</a> const& value) const -> <a href="supporttypes.html#dip-UnsignedArray" class="m-doc">dip::UnsignedArray</a></span>
</dt>
<dd>Gets the bin for <code>value</code> in an nD histogram</dd>
<dt id="dip-Histogram-At-dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-At-dip-uint--C" class="m-doc-self">At</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> x) const -> <a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a></span>
</dt>
<dd>Get the value at the given bin in a 1D histogram</dd>
<dt id="dip-Histogram-At-dip-uint--dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-At-dip-uint--dip-uint--C" class="m-doc-self">At</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> x,
<a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> y) const -> <a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a></span>
</dt>
<dd>Get the value at the given bin in a 2D histogram</dd>
<dt id="dip-Histogram-At-dip-uint--dip-uint--dip-uint--C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-At-dip-uint--dip-uint--dip-uint--C" class="m-doc-self">At</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> x,
<a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> y,
<a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> z) const -> <a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a></span>
</dt>
<dd>Get the value at the given bin in a 3D histogram</dd>
<dt id="dip-Histogram-At-UnsignedArray-CL-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-At-UnsignedArray-CL-C" class="m-doc-self">At</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-UnsignedArray" class="m-doc">dip::UnsignedArray</a> const& bin) const -> <a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a></span>
</dt>
<dd>Get the value at the given bin</dd>
<dt id="dip-Histogram-GetImage-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-GetImage-C" class="m-doc-self">GetImage</a>(</span><span class="m-doc-wrap">) const -> <a href="dip-Image.html" class="m-doc">dip::Image</a> const&</span>
</dt>
<dd>Get the image that holds the bin counts. The image is always scalar and of type <a href="dip-Histogram.html#dip-DT_COUNT"><code>dip::DT_COUNT</code></a>.</dd>
<dt id="dip-Histogram-begin-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-begin-C" class="m-doc-self">begin</a>(</span><span class="m-doc-wrap">) const -> <a href="dip-ImageIterator-T.html#dip-ConstImageIterator-T" class="m-doc">dip::ConstImageIterator</a></span>
</dt>
<dd>Returns an iterator to the first bin</dd>
<dt id="dip-Histogram-end">
<span class="m-doc-wrap-bumper">static auto <a href="#dip-Histogram-end" class="m-doc-self">end</a>(</span><span class="m-doc-wrap">) -> <a href="dip-ImageIterator-T.html#dip-ConstImageIterator-T" class="m-doc">dip::ConstImageIterator</a></span>
</dt>
<dd>Returns an end iterator</dd>
<dt id="dip-Histogram-Origin-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Origin-C" class="m-doc-self">Origin</a>(</span><span class="m-doc-wrap">) const -> <a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a> const*</span>
</dt>
<dd>Returns a pointer to the first bin</dd>
<dt id="dip-Histogram-Count-C">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Count-C" class="m-doc-self">Count</a>(</span><span class="m-doc-wrap">) const -> <a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a></span>
</dt>
<dd>Returns the total number of elements in the histogram (sum of bins)</dd>
<dt>
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Cumulative" class="m-doc">Cumulative</a>(</span><span class="m-doc-wrap">) -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&</span>
</dt>
<dd>Converts the histogram to a cumulative histogram. For each bin, it will contain the sum of that
bin with all the previous ones.</dd>
<dt>
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-GetMarginal-dip-uint--C" class="m-doc">GetMarginal</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim) const -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a></span>
</dt>
<dd>Returns the marginal histogram for dimension <code>dim</code>.</dd>
<dt>
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-Smooth-FloatArray-" class="m-doc">Smooth</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-FloatArray" class="m-doc">dip::FloatArray</a> sigma) -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&</span>
</dt>
<dd>Smooths the histogram, using Gaussian smoothing with parameters <code>sigma</code>.</dd>
</dl>
</section>
<section id="operator-members">
<h2>Operators</h2>
<dl class="m-doc">
<dt>
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-operator%2B%3D-Histogram-CL" class="m-doc">operator+=</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& other) -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&</span>
</dt>
<dd>Adds a histogram to *this. <code>other</code> must have identical properties.</dd>
<dt id="dip-Histogram-operator-%3D-Histogram-CL">
<span class="m-doc-wrap-bumper">auto <a href="#dip-Histogram-operator-%3D-Histogram-CL" class="m-doc-self">operator-=</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& other) -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&</span>
</dt>
<dd>Subtracts a histogram from *this, using saturated subtraction. <code>other</code> must have identical properties.</dd>
</dl>
</section>
<section id="related">
<h2>Related</h2>
<dl class="m-doc">
<dt id="dip-DT_COUNT">
<a href="dip-DataType.html" class="m-doc">dip::DataType</a> const <a href="#dip-DT_COUNT" class="m-doc-self">dip::<wbr />DT_COUNT</a> <span class="m-label m-flat m-primary">constexpr</span>
</dt>
<dd>Data type of histogram bins. See <a href="dip-Histogram.html#dip-Histogram-CountType"><code>dip::Histogram::CountType</code></a>.</dd>
<dt id="dip-operator%2B-Histogram-CL-Histogram-CL">
<span class="m-doc-wrap-bumper">auto <a href="#dip-operator%2B-Histogram-CL-Histogram-CL" class="m-doc-self">dip::<wbr />operator+</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& lhs,
<a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& rhs) -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a></span>
</dt>
<dd>Adds two histograms.</dd>
<dt id="dip-operator--Histogram-CL-Histogram-CL">
<span class="m-doc-wrap-bumper">auto <a href="#dip-operator--Histogram-CL-Histogram-CL" class="m-doc-self">dip::<wbr />operator-</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& lhs,
<a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& rhs) -> <a href="dip-Histogram.html" class="m-doc">dip::Histogram</a></span>
</dt>
<dd>Subtracts two histograms.</dd>
</dl>
</section>
<section>
<h2>Function documentation</h2>
<section class="m-doc-details" id="dip-Histogram-Histogram-Image-CL-Image-CL-ConfigurationArray-"><div>
<h3>
<span class="m-doc-wrap-bumper">
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Image-CL-Image-CL-ConfigurationArray-" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Image.html" class="m-doc">dip::Image</a> const& input,
<a href="dip-Image.html" class="m-doc">dip::Image</a> const& mask = {},
<a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration = {}) <span class="m-label m-info">explicit</span></span></span>
</h3>
<p>The constructor takes an image, an optional mask, and configuration options for each histogram
dimension.</p>
<p><code>configuration</code> should have as many elements as tensor elements in <code>input</code>. If <code>configuration</code> has only
one element, it will be used for all histogram dimensions. If it is an empty array, appropriate configuration
values for <code>input</code> are chosen based on its data type (see <a href="dip-Histogram-Configuration.html#dip-Histogram-Configuration-Configuration-DataType-"><code>dip::Histogram::Configuration::Configuration</code></a>).</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Histogram-Measurement-IteratorFeature-CL-ConfigurationArray-"><div>
<h3>
<span class="m-doc-wrap-bumper">
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Measurement-IteratorFeature-CL-ConfigurationArray-" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Measurement-IteratorFeature.html" class="m-doc">dip::Measurement::IteratorFeature</a> const& featureValues,
<a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration = {}) <span class="m-label m-info">explicit</span></span></span>
</h3>
<p>The constructor takes an <code>IteratorFeature</code> of a <a href="dip-Measurement.html"><code>dip::Measurement</code></a> object, and configuration
options for each histogram dimension.</p>
<p><code>configuration</code> should have as many elements as values in <code>featureValues</code>. If <code>configuration</code> has only
one element, it will be used for all histogram dimensions. In the default configuration, the histogram
will stretch from lowest to highest value, in 100 bins.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Histogram-ConfigurationArray-"><div>
<h3>
<span class="m-doc-wrap-bumper">
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-ConfigurationArray-" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html#dip-Histogram-ConfigurationArray" class="m-doc">dip::Histogram::ConfigurationArray</a> configuration) <span class="m-label m-info">explicit</span></span></span>
</h3>
<p>An empty histogram with the given configuration. Histogram bins are initialized to 0.</p>
<p>The array must not be empty. The histogram will have <code>configuration->size()</code> dimensions.
<code>configuration[ii].lowerIsPercentile</code> and <code>configuration[ii].upperIsPercentile</code> must all be false (since
there is no way of determining these percentiles).</p>
<p>The <code>GetImage</code> method returns a const reference to the histogram bins (in the form of an image),
but it is possible to modify the values in the bins (modify the pixel values of this image).</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Histogram-Configuration-CL"><div>
<h3>
<span class="m-doc-wrap-bumper">
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-Configuration-CL" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a> const& configuration) <span class="m-label m-info">explicit</span></span></span>
</h3>
<p>An empty histogram with the given configuration. Histogram bins are initialized to 0.</p>
<p>The histogram will have one dimension.
<code>configuration.lowerIsPercentile</code> and <code>configuration.upperIsPercentile</code> must both be false (since
there is no way of determining these percentiles).</p>
<p>The <code>GetImage</code> method returns a const reference to the histogram bins (in the form of an image),
but it is possible to modify the values in the bins (modify the pixel values of this image).</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Histogram-CountType-CP-Configuration-CL"><div>
<h3>
<span class="m-doc-wrap-bumper">
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Histogram-CountType-CP-Configuration-CL" class="m-doc-self">Histogram</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html#dip-Histogram-CountType" class="m-doc">dip::Histogram::CountType</a> const* data,
<a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a> const& configuration)</span></span>
</h3>
<p>Create a 1D histogram around existing data. No ownership is transferred.</p>
<p><code>data</code> is a raw pointer to the data that will be encapsulated by the output histogram. Data must
be contiguous and of type <a href="dip-Histogram.html#dip-Histogram-CountType"><code>dip::Histogram::CountType</code></a>. <code>configuration</code> determines how many
bins are pointed to by <code>data</code>.</p>
<p>Even though the data pointer is declared <code>const</code> here, it is possible to obtain a non-const
pointer to the data later.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-OptimalConfiguration"><div>
<h3>
<span class="m-doc-wrap-bumper">static <a href="dip-Histogram-Configuration.html" class="m-doc">dip::Histogram::Configuration</a>
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-OptimalConfiguration" class="m-doc-self">OptimalConfiguration</a>(</span><span class="m-doc-wrap">)</span></span>
</h3>
<p>Creates a <a href="dip-Histogram-Configuration.html"><code>dip::Histogram::Configuration</code></a> that uses the optimal bin size according to the Freedman–Diaconis rule.</p>
<p>The Freedman–Diaconis rule sets the bin size to <span class="m-math"><svg style="width: 4.663em; height: 1.191em; vertical-align: -0.265em; " viewBox="0 -9.26 46.63 11.91">
<title>
\(2 \text{IQR} / \sqrt[3]{n}\)
</title>
<defs>
<path id='eq116-g4-61' d='M5.65-1.24L5.48-1.39C5.4-1.29 5.31-1.18 5.23-1.08C4.88-.64 4.67-.45 4.5-.45C4.39-.45 4.31-.54 4.31-.64C4.31-.74 4.36-.96 4.48-1.39L5.16-3.85C5.23-4.1 5.26-4.36 5.26-4.53C5.26-4.95 4.94-5.25 4.48-5.25C3.72-5.25 2.97-4.53 1.74-2.63L2.54-5.23L2.5-5.25L.57-4.88V-4.69C1.18-4.68 1.33-4.61 1.33-4.37C1.33-4.3 1.32-4.23 1.31-4.17L.17 0H1.06C1.62-1.88 1.73-2.14 2.25-2.95C2.97-4.06 3.57-4.65 4.01-4.65C4.19-4.65 4.3-4.51 4.3-4.3C4.3-4.16 4.23-3.76 4.13-3.39L3.61-1.43C3.45-.81 3.42-.66 3.42-.54C3.42-.08 3.59 .11 3.98 .11C4.51 .11 4.81-.13 5.65-1.24Z'/>
<path id='eq116-g1-112' d='M8.73-.67H8.04L5.34 8.66L3 3.69L.71 4.91L.86 5.16L2.13 4.68L5.26 11.24L8.73-.67Z'/>
<path id='eq116-g1-157' d='M.74 2.3H1.36L4.74-8.42H4.12L.74 2.3Z'/>
<path id='eq116-g8-50' d='M3.11-.9L3.03-.93C2.78-.56 2.7-.5 2.4-.5H.84L1.94-1.65C2.52-2.26 2.78-2.76 2.78-3.27C2.78-3.92 2.25-4.43 1.57-4.43C1.21-4.43 .86-4.28 .62-4.02C.41-3.8 .31-3.59 .2-3.12L.34-3.09C.6-3.73 .84-3.94 1.29-3.94C1.84-3.94 2.21-3.57 2.21-3.02C2.21-2.51 1.91-1.9 1.36-1.32L.2-.08V0H2.75L3.11-.9Z'/>
<path id='eq116-g8-51' d='M2.83-1.43C2.83-1.77 2.73-2.08 2.54-2.28C2.4-2.42 2.28-2.5 1.99-2.63C2.44-2.93 2.61-3.18 2.61-3.53C2.61-4.06 2.19-4.43 1.59-4.43C1.26-4.43 .97-4.32 .73-4.11C.54-3.93 .44-3.76 .29-3.37L.39-3.34C.66-3.82 .96-4.04 1.37-4.04C1.79-4.04 2.09-3.75 2.09-3.33C2.09-3.1 1.99-2.86 1.83-2.7C1.63-2.5 1.45-2.4 1-2.25V-2.16C1.39-2.16 1.54-2.15 1.7-2.09C2.1-1.95 2.36-1.57 2.36-1.12C2.36-.57 1.98-.14 1.5-.14C1.32-.14 1.19-.19 .95-.35C.75-.47 .64-.51 .53-.51C.38-.51 .28-.42 .28-.28C.28-.05 .56 .09 1.02 .09C1.53 .09 2.04-.08 2.35-.35S2.83-1 2.83-1.43Z'/>
<path id='eq116-g12-73' d='M3.77 0V-.23C2.79-.26 2.59-.43 2.59-1.3V-6.61C2.59-7.48 2.76-7.64 3.77-7.69V-7.91H.22V-7.69C1.23-7.63 1.37-7.5 1.37-6.61V-1.3C1.37-.41 1.22-.26 .22-.23V0H3.77Z'/>
<path id='eq116-g12-81' d='M8.38 2.12V1.9C7.02 1.9 6.06 1.34 5.09 .08C5.91-.07 6.34-.27 6.89-.75C7.77-1.54 8.23-2.63 8.23-3.96C8.23-6.36 6.6-8.08 4.32-8.08S.41-6.36 .41-3.93C.41-2.76 .77-1.78 1.47-1.02C1.94-.51 2.32-.27 3.17 .01L3.73 .67C4.54 1.61 5.99 2.13 7.89 2.13C8.07 2.13 8.18 2.13 8.31 2.12H8.38ZM6.86-3.98C6.86-2.8 6.52-1.58 6.04-1.03C5.6-.54 4.97-.26 4.32-.26C3.74-.26 3.22-.47 2.79-.85C2.15-1.41 1.77-2.61 1.77-4C1.77-5.15 2.12-6.32 2.61-6.87C3.1-7.4 3.66-7.65 4.35-7.65C4.87-7.65 5.42-7.42 5.83-7.05C6.48-6.48 6.86-5.33 6.86-3.98Z'/>
<path id='eq116-g12-82' d='M7.88 0V-.23C7.42-.26 7.19-.38 6.84-.79L4.38-3.81C5.18-3.97 5.54-4.11 5.93-4.44C6.31-4.75 6.54-5.25 6.54-5.81C6.54-6.32 6.38-6.77 6.07-7.11C5.62-7.6 4.63-7.91 3.5-7.91H.2V-7.69C1.1-7.59 1.22-7.46 1.22-6.61V-1.43C1.22-.44 1.1-.3 .2-.23V0H3.51V-.23C2.59-.29 2.44-.44 2.44-1.3V-3.66L3.11-3.68L5.95 0H7.88ZM5.24-5.83C5.24-5.24 4.99-4.73 4.55-4.51C4-4.2 3.59-4.12 2.44-4.1V-7.04C2.44-7.38 2.57-7.47 3.05-7.47C4.54-7.47 5.24-6.96 5.24-5.83Z'/>
<use id='eq116-g11-50' xlink:href='#eq116-g8-50' transform='scale(1.82)'/>
</defs>
<g id='eq116-page1'>
<use x='0' y='0' xlink:href='#eq116-g11-50'/>
<use x='5.98' y='0' xlink:href='#eq116-g12-73'/>
<use x='9.96' y='0' xlink:href='#eq116-g12-81'/>
<use x='18.59' y='0' xlink:href='#eq116-g12-82'/>
<use x='26.56' y='0' xlink:href='#eq116-g1-157'/>
<use x='35.38' y='-4.33' xlink:href='#eq116-g8-51'/>
<use x='32.03' y='-8.59' xlink:href='#eq116-g1-112'/>
<rect x='40.44' y='-9.25' height='.66' width='6.19'/>
<use x='40.49' y='0' xlink:href='#eq116-g4-61'/>
</g>
</svg></span>, where IQR is the
interquartile range (the distance from the lower to the upper quartile), and <span class="m-math"><svg style="width: 0.565em; height: 0.536em; vertical-align: -0.011em; " viewBox=".06 -5.25 5.65 5.36">
<title>
\(n\)
</title>
<defs>
<path id='eq117-g1-61' d='M5.65-1.24L5.48-1.39C5.4-1.29 5.31-1.18 5.23-1.08C4.88-.64 4.67-.45 4.5-.45C4.39-.45 4.31-.54 4.31-.64C4.31-.74 4.36-.96 4.48-1.39L5.16-3.85C5.23-4.1 5.26-4.36 5.26-4.53C5.26-4.95 4.94-5.25 4.48-5.25C3.72-5.25 2.97-4.53 1.74-2.63L2.54-5.23L2.5-5.25L.57-4.88V-4.69C1.18-4.68 1.33-4.61 1.33-4.37C1.33-4.3 1.32-4.23 1.31-4.17L.17 0H1.06C1.62-1.88 1.73-2.14 2.25-2.95C2.97-4.06 3.57-4.65 4.01-4.65C4.19-4.65 4.3-4.51 4.3-4.3C4.3-4.16 4.23-3.76 4.13-3.39L3.61-1.43C3.45-.81 3.42-.66 3.42-.54C3.42-.08 3.59 .11 3.98 .11C4.51 .11 4.81-.13 5.65-1.24Z'/>
</defs>
<g id='eq117-page1'>
<use x='.06' y='0' xlink:href='#eq117-g1-61'/>
</g>
</svg></span> is the number of samples
over which the histogram will be computed.</p>
<p>The histogram limits are chosen to avoid extremely large histograms, by ignoring values 50 IQRs below the
lower quartile or above the upper quartile.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Copy-C"><div>
<h3>
<span class="m-doc-wrap-bumper"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Copy-C" class="m-doc-self">Copy</a>(</span><span class="m-doc-wrap">) const</span></span>
</h3>
<p>Deep copy, returns a copy of <code>this</code> with its own data segment.</p>
<p>When making a copy of a histogram, the data segment is shared:</p>
<div class="m-code"><pre><span></span><span class="n">Histogram</span><span class="w"> </span><span class="n">second</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">first</span><span class="p">;</span>
<span class="n">second</span><span class="p">.</span><span class="n">Smooth</span><span class="p">();</span><span class="w"> </span><span class="c1">// modifies `first` also!</span>
</pre></div>
<p>In contrast, this function returns a deep copy of <code>this</code>, with its own data segment:</p>
<div class="m-code"><pre><span></span><span class="n">Histogram</span><span class="w"> </span><span class="n">second</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">first</span><span class="p">.</span><span class="n">Copy</span><span class="p">();</span>
<span class="n">second</span><span class="p">.</span><span class="n">Smooth</span><span class="p">();</span><span class="w"> </span><span class="c1">// OK</span>
</pre></div>
</div></section>
<section class="m-doc-details" id="dip-Histogram-ReverseLookup-Image-CL-Image-L-BooleanArray-"><div>
<h3>
<span class="m-doc-wrap-bumper">void
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-ReverseLookup-Image-CL-Image-L-BooleanArray-" class="m-doc-self">ReverseLookup</a>(</span><span class="m-doc-wrap"><a href="dip-Image.html" class="m-doc">dip::Image</a> const& input,
<a href="dip-Image.html" class="m-doc">dip::Image</a>& out,
<a href="supporttypes.html#dip-BooleanArray" class="m-doc">dip::BooleanArray</a> excludeOutOfBoundValues = {false})</span></span>
</h3>
<p>Performs a reverse histogram lookup, yielding an image “painted” with the bin values.</p>
<p>The bin corresponding to each pixel in the input image is found in the histogram, and this bin’s
value is written to <code>output</code>.</p>
<p><code>input</code> must be similar to the image used to generate the histogram (at least have the same number
of tensor elements, which corresponds to the dimensionality of the histogram). The lookup occurs
in the same way as when generating the histogram. The <code>excludeOutOfBoundValues</code> parameter for each
dimension indicates if an edge bin is found or no bin is found (yielding a 0 output) if the pixel
is not represented in the histogram.</p>
<p><code>output</code> is a scalar image with data type <a href="dip-Histogram.html#dip-Histogram-CountType"><code>dip::Histogram::CountType</code></a>, containing the histogram
bin values.</p>
<p>This function is particularly interesting when applied to a histogram resulting from clustering
algorithms such as <a href="histograms.html#dip-KMeansClustering-Histogram-CL-dip-uint-"><code>dip::KMeansClustering</code></a> or
<a href="histograms.html#dip-MinimumVariancePartitioning-Histogram-CL-dip-uint-"><code>dip::MinimumVariancePartitioning</code></a>.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Cumulative"><div>
<h3>
<span class="m-doc-wrap-bumper"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Cumulative" class="m-doc-self">Cumulative</a>(</span><span class="m-doc-wrap">)</span></span>
</h3>
<p>Converts the histogram to a cumulative histogram. For each bin, it will contain the sum of that
bin with all the previous ones.</p>
<p>The cumulative histogram has <code>this->Count()</code> as the right-most bin. The <code>Count</code> method applied to the
cumulative histogram is meaningless, as are <code>Mean</code> and the other statistics functions.</p>
<p>For a multi-dimensional histogram, the cumulative histogram has <code>bin(i,j,k)</code> equal to the sum of all bins
with indices equal or smaller to <code>i</code>, <code>j</code> and <code>k</code>: <code>bin(1..i,1..j,1..k)</code>. It is computed through the
<a href="math_statistics.html#dip-CumulativeSum-Image-CL-Image-CL-Image-L-BooleanArray-CL"><code>dip::CumulativeSum</code></a> function.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-GetMarginal-dip-uint--C"><div>
<h3>
<span class="m-doc-wrap-bumper"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-GetMarginal-dip-uint--C" class="m-doc-self">GetMarginal</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-uint" class="m-doc">dip::uint</a> dim) const</span></span>
</h3>
<p>Returns the marginal histogram for dimension <code>dim</code>.</p>
<p>The marginal histogram represents the marginal intensity distribution. It is a 1D histogram determined
by summing over all dimensions except <code>dim</code>, and is equivalent to the histogram for tensor element
<code>dim</code>.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-Smooth-FloatArray-"><div>
<h3>
<span class="m-doc-wrap-bumper"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-Smooth-FloatArray-" class="m-doc-self">Smooth</a>(</span><span class="m-doc-wrap"><a href="supporttypes.html#dip-FloatArray" class="m-doc">dip::FloatArray</a> sigma)</span></span>
</h3>
<p>Smooths the histogram, using Gaussian smoothing with parameters <code>sigma</code>.</p>
<p>Set a single sigma value, or one value per histogram dimension. The value is in bins, yielding a Gaussian
kernel of size <code>2 * std::ceil( 3 * sigma ) + 1</code> bins. See <a href="linear.html#dip-GaussFIR-Image-CL-Image-L-FloatArray--UnsignedArray--StringArray-CL-dfloat-"><code>dip::GaussFIR</code></a> for information on the smoothing
operation applied. <code>sigma</code> defaults to 1.</p>
<p>The histogram is extended by <code>std::ceil( 3 * sigma )</code> below and above the original bounds, to prevent the
histogram count to change.</p>
</div></section>
<section class="m-doc-details" id="dip-Histogram-operator%2B%3D-Histogram-CL"><div>
<h3>
<span class="m-doc-wrap-bumper"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a>&
</span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#dip-Histogram-operator%2B%3D-Histogram-CL" class="m-doc-self">operator+=</a>(</span><span class="m-doc-wrap"><a href="dip-Histogram.html" class="m-doc">dip::Histogram</a> const& other)</span></span>
</h3>
<p>Adds a histogram to *this. <code>other</code> must have identical properties.</p>
<p>Adding multiple histograms together can be useful, for example, when accumulating pixel values
from multiple images, or in multiple threads.</p>
</div></section>
</section>
</div>
</div>
</div>
</article></main>
<div class="m-doc-search" id="search">
<a href="#!" onclick="return hideSearch()"></a>
<div class="m-container">
<div class="m-row">
<div class="m-col-m-8 m-push-m-2">
<div class="m-doc-search-header m-text m-small">
<div><span class="m-label m-default">Tab</span> / <span class="m-label m-default">T</span> to search, <span class="m-label m-default">Esc</span> to close</div>
<div id="search-symbolcount">…</div>
</div>
<div class="m-doc-search-content">
<form action="https://diplib.org/diplib-docs/#search">
<input type="search" name="q" id="search-input" placeholder="Loading …" disabled="disabled" autofocus="autofocus" autocomplete="off" spellcheck="false" />
</form>
<noscript class="m-text m-danger m-text-center">Unlike everything else in the docs, the search functionality <em>requires</em> JavaScript. Enable it or <a href="https://google.com/search?q=site:diplib.org+">use an external search engine</a>.</noscript>
<div id="search-help" class="m-text m-dim m-text-center">
<p class="m-noindent">Search for symbols, directories, files, pages or modules.
You can omit any prefix from the symbol or file path; adding a <code>:</code> or
<code>/</code> suffix lists all members of given symbol or directory.</p>
<p class="m-noindent">Use <span class="m-label m-dim">↓</span> / <span class="m-label m-dim">↑</span> to navigate through the list,
<span class="m-label m-dim">Enter</span> to go.
<span class="m-label m-dim">Tab</span> autocompletes common prefix.
You can copy a link to the result using <span class="m-label m-dim">⌘</span> <span class="m-label m-dim">L</span>,
or <span class="m-label m-dim">⌘</span> <span class="m-label m-dim">M</span> to copy a Markdown link.</p>
</div>
<div id="search-notfound" class="m-text m-warning m-text-center">Sorry, nothing was found.<br />Maybe try a full-text <a href="#" id="search-external" data-search-engine="https://google.com/search?q=site:diplib.org+{query}">search with external engine</a>?</div>
<ul id="search-results"></ul>
</div>
</div>
</div>
</div>
</div>
<script src="search-v1.js"></script>
<script src="searchdata-v1.js" async="async"></script>
<footer><nav>
<div class="m-container">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<p>DIPlib, a library for quantitative image analysis. Documentation compiled with <a href="https://crisluengo.github.io/doxpp/">dox++</a> and styled with <a href="https://mcss.mosra.cz/">m.css</a>.</p>
</div>
</div>
</div>
</nav></footer>
</body>
</html>