VTK  9.1.0
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=========================================================================*/
50#ifndef vtkImageHistogram_h
51#define vtkImageHistogram_h
52
53#include "vtkImagingStatisticsModule.h" // For export macro
55
57class vtkIdTypeArray;
58class vtkImageHistogramThreadData;
59class vtkImageHistogramSMPThreadLocal;
60
61class VTKIMAGINGSTATISTICS_EXPORT vtkImageHistogram : public vtkThreadedImageAlgorithm
62{
63public:
66
67 void PrintSelf(ostream& os, vtkIndent indent) override;
68
72 enum
73 {
74 Linear = 0,
75 Log = 1,
76 Sqrt = 2
77 };
78
80
85 vtkSetMacro(ActiveComponent, int);
86 vtkGetMacro(ActiveComponent, int);
88
90
101 vtkSetMacro(AutomaticBinning, vtkTypeBool);
102 vtkBooleanMacro(AutomaticBinning, vtkTypeBool);
103 vtkGetMacro(AutomaticBinning, vtkTypeBool);
105
107
115 vtkSetMacro(MaximumNumberOfBins, int);
116 vtkGetMacro(MaximumNumberOfBins, int);
118
120
124 vtkSetMacro(NumberOfBins, int);
125 vtkGetMacro(NumberOfBins, int);
127
129
133 vtkSetMacro(BinOrigin, double);
134 vtkGetMacro(BinOrigin, double);
136
138
142 vtkSetMacro(BinSpacing, double);
143 vtkGetMacro(BinSpacing, double);
145
147
153
158
160
165 vtkSetMacro(GenerateHistogramImage, vtkTypeBool);
166 vtkBooleanMacro(GenerateHistogramImage, vtkTypeBool);
167 vtkGetMacro(GenerateHistogramImage, vtkTypeBool);
169
171
175 vtkSetVector2Macro(HistogramImageSize, int);
176 vtkGetVector2Macro(HistogramImageSize, int);
178
180
184 vtkSetClampMacro(HistogramImageScale, int, vtkImageHistogram::Linear, vtkImageHistogram::Sqrt);
185 void SetHistogramImageScaleToLinear() { this->SetHistogramImageScale(vtkImageHistogram::Linear); }
186 void SetHistogramImageScaleToLog() { this->SetHistogramImageScale(vtkImageHistogram::Log); }
187 void SetHistogramImageScaleToSqrt() { this->SetHistogramImageScale(vtkImageHistogram::Sqrt); }
188 vtkGetMacro(HistogramImageScale, int);
191
197
202 vtkIdType GetTotal() { return this->Total; }
203
209 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
210 int id) override;
211
212protected:
215
216 int RequestUpdateExtent(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
217 vtkInformationVector* vtkNotUsed(outInfo)) override;
218 int RequestInformation(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
219 vtkInformationVector* vtkNotUsed(outInfo)) override;
221
224
231
235
236 int HistogramImageSize[2];
239
241 double BinOrigin;
243
246
247 // Used for vtkMultiThreader operation.
248 vtkImageHistogramThreadData* ThreadData;
249
250 // Used for vtkSMPTools operation.
251 vtkImageHistogramSMPThreadLocal* SMPThreadData;
252
253private:
254 vtkImageHistogram(const vtkImageHistogram&) = delete;
255 void operator=(const vtkImageHistogram&) = delete;
256
257 friend class vtkImageHistogramFunctor;
258};
259
260#endif
Proxy object to connect input/output ports.
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
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 by the superclass.
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:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
@ data
Definition: vtkX3D.h:321
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332