VTK  9.2.6
vtkImageHistogram.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageHistogram.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
46#ifndef vtkImageHistogram_h
47#define vtkImageHistogram_h
48
49#include "vtkImagingStatisticsModule.h" // For export macro
51
53class vtkIdTypeArray;
54class vtkImageHistogramThreadData;
55class vtkImageHistogramSMPThreadLocal;
56
57class VTKIMAGINGSTATISTICS_EXPORT vtkImageHistogram : public vtkThreadedImageAlgorithm
58{
59public:
62
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
68 enum
69 {
70 Linear = 0,
71 Log = 1,
72 Sqrt = 2
73 };
74
76
81 vtkSetMacro(ActiveComponent, int);
82 vtkGetMacro(ActiveComponent, int);
84
86
97 vtkSetMacro(AutomaticBinning, vtkTypeBool);
98 vtkBooleanMacro(AutomaticBinning, vtkTypeBool);
99 vtkGetMacro(AutomaticBinning, vtkTypeBool);
101
103
111 vtkSetMacro(MaximumNumberOfBins, int);
112 vtkGetMacro(MaximumNumberOfBins, int);
114
116
120 vtkSetMacro(NumberOfBins, int);
121 vtkGetMacro(NumberOfBins, int);
123
125
129 vtkSetMacro(BinOrigin, double);
130 vtkGetMacro(BinOrigin, double);
132
134
138 vtkSetMacro(BinSpacing, double);
139 vtkGetMacro(BinSpacing, double);
141
143
149
154
156
161 vtkSetMacro(GenerateHistogramImage, vtkTypeBool);
162 vtkBooleanMacro(GenerateHistogramImage, vtkTypeBool);
163 vtkGetMacro(GenerateHistogramImage, vtkTypeBool);
165
167
171 vtkSetVector2Macro(HistogramImageSize, int);
172 vtkGetVector2Macro(HistogramImageSize, int);
174
176
180 vtkSetClampMacro(HistogramImageScale, int, vtkImageHistogram::Linear, vtkImageHistogram::Sqrt);
181 void SetHistogramImageScaleToLinear() { this->SetHistogramImageScale(vtkImageHistogram::Linear); }
182 void SetHistogramImageScaleToLog() { this->SetHistogramImageScale(vtkImageHistogram::Log); }
183 void SetHistogramImageScaleToSqrt() { this->SetHistogramImageScale(vtkImageHistogram::Sqrt); }
184 vtkGetMacro(HistogramImageScale, int);
187
193
198 vtkIdType GetTotal() { return this->Total; }
199
205 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
206 int id) override;
207
208protected:
211
212 int RequestUpdateExtent(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
213 vtkInformationVector* vtkNotUsed(outInfo)) override;
214 int RequestInformation(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
215 vtkInformationVector* vtkNotUsed(outInfo)) override;
217
218 int FillInputPortInformation(int port, vtkInformation* info) override;
219 int FillOutputPortInformation(int port, vtkInformation* info) override;
220
226 void ComputeImageScalarRange(vtkImageData* data, double range[2]);
227
231
232 int HistogramImageSize[2];
235
237 double BinOrigin;
239
242
243 // Used for vtkMultiThreader operation.
244 vtkImageHistogramThreadData* ThreadData;
245
246 // Used for vtkSMPTools operation.
247 vtkImageHistogramSMPThreadLocal* SMPThreadData;
248
249private:
250 vtkImageHistogram(const vtkImageHistogram&) = delete;
251 void operator=(const vtkImageHistogram&) = delete;
252
253 friend class vtkImageHistogramFunctor;
254};
255
256#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:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition vtkABI.h:69
int vtkIdType
Definition vtkType.h:332