VTK
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 =========================================================================*/
37 #ifndef vtkImageHistogram_h
38 #define vtkImageHistogram_h
39 
40 #include "vtkImagingStatisticsModule.h" // For export macro
42 
44 class vtkIdTypeArray;
45 class vtkImageHistogramThreadData;
46 class vtkImageHistogramSMPThreadLocal;
47 
48 class VTKIMAGINGSTATISTICS_EXPORT vtkImageHistogram : public vtkThreadedImageAlgorithm
49 {
50 public:
53 
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
59  enum {
60  Linear = 0,
61  Log = 1,
62  Sqrt = 2
63  };
64 
66 
71  vtkSetMacro(ActiveComponent, int);
72  vtkGetMacro(ActiveComponent, int);
74 
76 
87  vtkSetMacro(AutomaticBinning, vtkTypeBool);
88  vtkBooleanMacro(AutomaticBinning, vtkTypeBool);
89  vtkGetMacro(AutomaticBinning, vtkTypeBool);
91 
93 
101  vtkSetMacro(MaximumNumberOfBins, int);
102  vtkGetMacro(MaximumNumberOfBins, int);
104 
106 
110  vtkSetMacro(NumberOfBins, int);
111  vtkGetMacro(NumberOfBins, int);
113 
115 
119  vtkSetMacro(BinOrigin, double);
120  vtkGetMacro(BinOrigin, double);
122 
124 
128  vtkSetMacro(BinSpacing, double);
129  vtkGetMacro(BinSpacing, double);
131 
133 
139 
144 
146 
151  vtkSetMacro(GenerateHistogramImage, vtkTypeBool);
152  vtkBooleanMacro(GenerateHistogramImage, vtkTypeBool);
153  vtkGetMacro(GenerateHistogramImage, vtkTypeBool);
155 
157 
161  vtkSetVector2Macro(HistogramImageSize, int);
162  vtkGetVector2Macro(HistogramImageSize, int);
164 
166 
170  vtkSetClampMacro(HistogramImageScale, int,
173  this->SetHistogramImageScale(vtkImageHistogram::Linear); }
175  this->SetHistogramImageScale(vtkImageHistogram::Log); }
177  this->SetHistogramImageScale(vtkImageHistogram::Sqrt); }
178  vtkGetMacro(HistogramImageScale, int);
181 
187 
192  vtkIdType GetTotal() { return this->Total; }
193 
199  vtkInformationVector **inputVector,
200  vtkInformationVector *outputVector,
201  vtkImageData ***inData,
202  vtkImageData **outData, int ext[6], int id) override;
203 
204 protected:
206  ~vtkImageHistogram() override;
207 
208  int RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
209  vtkInformationVector **inInfo,
210  vtkInformationVector *vtkNotUsed(outInfo)) override;
211  int RequestInformation(vtkInformation *vtkNotUsed(request),
212  vtkInformationVector **inInfo,
213  vtkInformationVector *vtkNotUsed(outInfo)) override;
216  vtkInformationVector *) override;
217 
220 
227 
231 
232  int HistogramImageSize[2];
235 
237  double BinOrigin;
238  double BinSpacing;
239 
242 
243  // Used for vtkMultiThreader operation.
244  vtkImageHistogramThreadData *ThreadData;
245 
246  // Used for vtkSMPTools operation.
247  vtkImageHistogramSMPThreadLocal *SMPThreadData;
248 
249 private:
250  vtkImageHistogram(const vtkImageHistogram&) = delete;
251  void operator=(const vtkImageHistogram&) = delete;
252 
253  friend class vtkImageHistogramFunctor;
254 };
255 
256 #endif
vtkImageHistogram::BinSpacing
double BinSpacing
Definition: vtkImageHistogram.h:238
vtkImageHistogram::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkImageHistogram::BinOrigin
double BinOrigin
Definition: vtkImageHistogram.h:237
vtkImageHistogram::GenerateHistogramImage
vtkTypeBool GenerateHistogramImage
Definition: vtkImageHistogram.h:234
vtkImageHistogram
Compute the histogram for an image.
Definition: vtkImageHistogram.h:49
vtkImageHistogram::ThreadData
vtkImageHistogramThreadData * ThreadData
Definition: vtkImageHistogram.h:244
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkImageHistogram::ComputeImageScalarRange
void ComputeImageScalarRange(vtkImageData *data, double range[2])
Compute the range of the data.
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkImageHistogram::vtkImageHistogram
vtkImageHistogram()
vtkImageHistogram::GetTotal
vtkIdType GetTotal()
Get the total count of the histogram.
Definition: vtkImageHistogram.h:192
vtkImageHistogram::SMPThreadData
vtkImageHistogramSMPThreadLocal * SMPThreadData
Definition: vtkImageHistogram.h:247
vtkImageHistogram::Histogram
vtkIdTypeArray * Histogram
Definition: vtkImageHistogram.h:240
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:44
vtkImageHistogram::FillOutputPortInformation
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::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkImageHistogram::~vtkImageHistogram
~vtkImageHistogram() override
vtkImageHistogram::SetHistogramImageScaleToSqrt
void SetHistogramImageScaleToSqrt()
Definition: vtkImageHistogram.h:176
vtkThreadedImageAlgorithm.h
vtkImageHistogram::Total
vtkIdType Total
Definition: vtkImageHistogram.h:241
vtkImageHistogram::SetStencilData
void SetStencilData(vtkImageStencilData *stencil)
Use a stencil to compute the histogram for just a part of the image.
vtkImageHistogram::GetStencil
vtkImageStencilData * GetStencil()
vtkImageHistogram::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageHistogram::RequestInformation
int RequestInformation(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo)) override
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkImageHistogram::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo)) override
vtkImageHistogram::NumberOfBins
int NumberOfBins
Definition: vtkImageHistogram.h:236
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkImageHistogram::AutomaticBinning
vtkTypeBool AutomaticBinning
Definition: vtkImageHistogram.h:229
vtkImageHistogram::MaximumNumberOfBins
int MaximumNumberOfBins
Definition: vtkImageHistogram.h:230
vtkImageHistogram::Linear
@ Linear
Definition: vtkImageHistogram.h:60
vtkImageHistogram::HistogramImageScale
int HistogramImageScale
Definition: vtkImageHistogram.h:233
vtkImageHistogram::GetHistogramImageScaleAsString
const char * GetHistogramImageScaleAsString()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkImageHistogram::SetStencilConnection
void SetStencilConnection(vtkAlgorithmOutput *algOutput)
Equivalent to SetInputConnection(1, algOutput).
vtkImageHistogram::SetHistogramImageScaleToLog
void SetHistogramImageScaleToLog()
Definition: vtkImageHistogram.h:174
vtkImageHistogram::SetHistogramImageScaleToLinear
void SetHistogramImageScaleToLinear()
Definition: vtkImageHistogram.h:172
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkImageHistogram::ActiveComponent
int ActiveComponent
Definition: vtkImageHistogram.h:228
vtkImageHistogram::Log
@ Log
Definition: vtkImageHistogram.h:61
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:40
vtkImageHistogram::ThreadedRequestData
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.
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:38
vtkImageHistogram::New
static vtkImageHistogram * New()
vtkImageHistogram::Sqrt
@ Sqrt
Definition: vtkImageHistogram.h:62
vtkImageHistogram::GetHistogram
vtkIdTypeArray * GetHistogram()
Get the histogram as a vtkIdTypeArray.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69