VTK  9.3.0
vtkImageHistogram.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
34#ifndef vtkImageHistogram_h
35#define vtkImageHistogram_h
36
37#include "vtkImagingStatisticsModule.h" // For export macro
39
40VTK_ABI_NAMESPACE_BEGIN
42class vtkIdTypeArray;
43class vtkImageHistogramThreadData;
44class vtkImageHistogramSMPThreadLocal;
45
46class VTKIMAGINGSTATISTICS_EXPORT vtkImageHistogram : public vtkThreadedImageAlgorithm
47{
48public:
51
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
57 enum
58 {
59 Linear = 0,
60 Log = 1,
61 Sqrt = 2
62 };
63
65
70 vtkSetMacro(ActiveComponent, int);
71 vtkGetMacro(ActiveComponent, int);
73
75
86 vtkSetMacro(AutomaticBinning, vtkTypeBool);
87 vtkBooleanMacro(AutomaticBinning, vtkTypeBool);
88 vtkGetMacro(AutomaticBinning, vtkTypeBool);
90
92
100 vtkSetMacro(MaximumNumberOfBins, int);
101 vtkGetMacro(MaximumNumberOfBins, int);
103
105
109 vtkSetMacro(NumberOfBins, int);
110 vtkGetMacro(NumberOfBins, int);
112
114
118 vtkSetMacro(BinOrigin, double);
119 vtkGetMacro(BinOrigin, double);
121
123
127 vtkSetMacro(BinSpacing, double);
128 vtkGetMacro(BinSpacing, double);
130
132
138
143
145
150 vtkSetMacro(GenerateHistogramImage, vtkTypeBool);
151 vtkBooleanMacro(GenerateHistogramImage, vtkTypeBool);
152 vtkGetMacro(GenerateHistogramImage, vtkTypeBool);
154
156
160 vtkSetVector2Macro(HistogramImageSize, int);
161 vtkGetVector2Macro(HistogramImageSize, int);
163
165
169 vtkSetClampMacro(HistogramImageScale, int, vtkImageHistogram::Linear, vtkImageHistogram::Sqrt);
170 void SetHistogramImageScaleToLinear() { this->SetHistogramImageScale(vtkImageHistogram::Linear); }
171 void SetHistogramImageScaleToLog() { this->SetHistogramImageScale(vtkImageHistogram::Log); }
172 void SetHistogramImageScaleToSqrt() { this->SetHistogramImageScale(vtkImageHistogram::Sqrt); }
173 vtkGetMacro(HistogramImageScale, int);
176
182
187 vtkIdType GetTotal() { return this->Total; }
188
194 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
195 int id) override;
196
197protected:
200
201 int RequestUpdateExtent(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
202 vtkInformationVector* vtkNotUsed(outInfo)) override;
203 int RequestInformation(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
204 vtkInformationVector* vtkNotUsed(outInfo)) override;
206
207 int FillInputPortInformation(int port, vtkInformation* info) override;
208 int FillOutputPortInformation(int port, vtkInformation* info) override;
209
215 void ComputeImageScalarRange(vtkImageData* data, double range[2]);
216
220
221 int HistogramImageSize[2];
224
226 double BinOrigin;
228
231
232 // Used for vtkMultiThreader operation.
233 vtkImageHistogramThreadData* ThreadData;
234
235 // Used for vtkSMPTools operation.
236 vtkImageHistogramSMPThreadLocal* SMPThreadData;
237
238private:
239 vtkImageHistogram(const vtkImageHistogram&) = delete;
240 void operator=(const vtkImageHistogram&) = delete;
241
242 friend class vtkImageHistogramFunctor;
243};
244
245VTK_ABI_NAMESPACE_END
246#endif
Proxy object to connect input/output ports.
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Compute the histogram for an image.
vtkTypeBool GenerateHistogramImage
void SetStencilData(vtkImageStencilData *stencil)
Use a stencil to compute the histogram for just a part of the image.
void SetHistogramImageScaleToLog()
Set the scale to use for the histogram image.
int RequestUpdateExtent(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo)) override
vtkIdTypeArray * GetHistogram()
Get the histogram as a vtkIdTypeArray.
static vtkImageHistogram * New()
const char * GetHistogramImageScaleAsString()
Set the scale to use for the histogram image.
vtkImageStencilData * GetStencil()
Use a stencil to compute the histogram for just a part of the image.
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkImageHistogramThreadData * ThreadData
vtkTypeBool AutomaticBinning
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id) override
This is part of the executive, but is public so that it can be accessed by non-member functions.
void ComputeImageScalarRange(vtkImageData *data, double range[2])
Compute the range of the data.
int FillOutputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
~vtkImageHistogram() override
void SetHistogramImageScaleToLinear()
Set the scale to use for the histogram image.
void SetStencilConnection(vtkAlgorithmOutput *algOutput)
Equivalent to SetInputConnection(1, algOutput).
vtkImageHistogramSMPThreadLocal * SMPThreadData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
void SetHistogramImageScaleToSqrt()
Set the scale to use for the histogram image.
int RequestInformation(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo)) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdTypeArray * Histogram
vtkIdType GetTotal()
Get the total count of the histogram.
efficient description of an image stencil
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315