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
25#ifndef vtkImageHistogram_h
26#define vtkImageHistogram_h
27
28#include "vtkImagingStatisticsModule.h" // For export macro
30
31VTK_ABI_NAMESPACE_BEGIN
33class vtkIdTypeArray;
34class vtkImageHistogramThreadData;
35class vtkImageHistogramSMPThreadLocal;
36
37class VTKIMAGINGSTATISTICS_EXPORT vtkImageHistogram : public vtkThreadedImageAlgorithm
38{
39public:
42
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
48 enum
49 {
50 Linear = 0,
51 Log = 1,
52 Sqrt = 2
53 };
54
56
61 vtkSetMacro(ActiveComponent, int);
62 vtkGetMacro(ActiveComponent, int);
64
66
77 vtkSetMacro(AutomaticBinning, vtkTypeBool);
78 vtkBooleanMacro(AutomaticBinning, vtkTypeBool);
79 vtkGetMacro(AutomaticBinning, vtkTypeBool);
81
83
91 vtkSetMacro(MaximumNumberOfBins, int);
92 vtkGetMacro(MaximumNumberOfBins, int);
94
96
100 vtkSetMacro(NumberOfBins, int);
101 vtkGetMacro(NumberOfBins, int);
103
105
109 vtkSetMacro(BinOrigin, double);
110 vtkGetMacro(BinOrigin, double);
112
114
118 vtkSetMacro(BinSpacing, double);
119 vtkGetMacro(BinSpacing, double);
121
123
129
134
136
141 vtkSetMacro(GenerateHistogramImage, vtkTypeBool);
142 vtkBooleanMacro(GenerateHistogramImage, vtkTypeBool);
143 vtkGetMacro(GenerateHistogramImage, vtkTypeBool);
145
147
151 vtkSetVector2Macro(HistogramImageSize, int);
152 vtkGetVector2Macro(HistogramImageSize, int);
154
156
160 vtkSetClampMacro(HistogramImageScale, int, vtkImageHistogram::Linear, vtkImageHistogram::Sqrt);
161 void SetHistogramImageScaleToLinear() { this->SetHistogramImageScale(vtkImageHistogram::Linear); }
162 void SetHistogramImageScaleToLog() { this->SetHistogramImageScale(vtkImageHistogram::Log); }
163 void SetHistogramImageScaleToSqrt() { this->SetHistogramImageScale(vtkImageHistogram::Sqrt); }
164 vtkGetMacro(HistogramImageScale, int);
167
173
178 vtkIdType GetTotal() { return this->Total; }
179
185 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
186 int id) override;
187
188protected:
191
192 int RequestUpdateExtent(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
193 vtkInformationVector* vtkNotUsed(outInfo)) override;
194 int RequestInformation(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
195 vtkInformationVector* vtkNotUsed(outInfo)) override;
197
198 int FillInputPortInformation(int port, vtkInformation* info) override;
199 int FillOutputPortInformation(int port, vtkInformation* info) override;
200
206 void ComputeImageScalarRange(vtkImageData* data, double range[2]);
207
211
212 int HistogramImageSize[2];
215
217 double BinOrigin;
219
222
223 // Used for vtkMultiThreader operation.
224 vtkImageHistogramThreadData* ThreadData;
225
226 // Used for vtkSMPTools operation.
227 vtkImageHistogramSMPThreadLocal* SMPThreadData;
228
229private:
230 vtkImageHistogram(const vtkImageHistogram&) = delete;
231 void operator=(const vtkImageHistogram&) = delete;
232
233 friend class vtkImageHistogramFunctor;
234};
235
236VTK_ABI_NAMESPACE_END
237#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:29
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