VTK  9.0.20210616
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 =========================================================================*/
31 #ifndef vtkImageHistogram_h
32 #define vtkImageHistogram_h
33 
34 #include "vtkImagingStatisticsModule.h" // For export macro
36 
38 class vtkIdTypeArray;
39 class vtkImageHistogramThreadData;
40 class vtkImageHistogramSMPThreadLocal;
41 
42 class VTKIMAGINGSTATISTICS_EXPORT vtkImageHistogram : public vtkThreadedImageAlgorithm
43 {
44 public:
47 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  enum
54  {
55  Linear = 0,
56  Log = 1,
57  Sqrt = 2
58  };
59 
61 
66  vtkSetMacro(ActiveComponent, int);
67  vtkGetMacro(ActiveComponent, int);
69 
71 
82  vtkSetMacro(AutomaticBinning, vtkTypeBool);
83  vtkBooleanMacro(AutomaticBinning, vtkTypeBool);
84  vtkGetMacro(AutomaticBinning, vtkTypeBool);
86 
88 
96  vtkSetMacro(MaximumNumberOfBins, int);
97  vtkGetMacro(MaximumNumberOfBins, int);
99 
101 
105  vtkSetMacro(NumberOfBins, int);
106  vtkGetMacro(NumberOfBins, int);
108 
110 
114  vtkSetMacro(BinOrigin, double);
115  vtkGetMacro(BinOrigin, double);
117 
119 
123  vtkSetMacro(BinSpacing, double);
124  vtkGetMacro(BinSpacing, double);
126 
128 
134 
139 
141 
146  vtkSetMacro(GenerateHistogramImage, vtkTypeBool);
147  vtkBooleanMacro(GenerateHistogramImage, vtkTypeBool);
148  vtkGetMacro(GenerateHistogramImage, vtkTypeBool);
150 
152 
156  vtkSetVector2Macro(HistogramImageSize, int);
157  vtkGetVector2Macro(HistogramImageSize, int);
159 
161 
165  vtkSetClampMacro(HistogramImageScale, int, vtkImageHistogram::Linear, vtkImageHistogram::Sqrt);
166  void SetHistogramImageScaleToLinear() { this->SetHistogramImageScale(vtkImageHistogram::Linear); }
167  void SetHistogramImageScaleToLog() { this->SetHistogramImageScale(vtkImageHistogram::Log); }
168  void SetHistogramImageScaleToSqrt() { this->SetHistogramImageScale(vtkImageHistogram::Sqrt); }
169  vtkGetMacro(HistogramImageScale, int);
172 
178 
183  vtkIdType GetTotal() { return this->Total; }
184 
190  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
191  int id) override;
192 
193 protected:
195  ~vtkImageHistogram() override;
196 
197  int RequestUpdateExtent(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
198  vtkInformationVector* vtkNotUsed(outInfo)) override;
199  int RequestInformation(vtkInformation* vtkNotUsed(request), vtkInformationVector** inInfo,
200  vtkInformationVector* vtkNotUsed(outInfo)) override;
202 
205 
212 
216 
217  int HistogramImageSize[2];
220 
222  double BinOrigin;
223  double BinSpacing;
224 
227 
228  // Used for vtkMultiThreader operation.
229  vtkImageHistogramThreadData* ThreadData;
230 
231  // Used for vtkSMPTools operation.
232  vtkImageHistogramSMPThreadLocal* SMPThreadData;
233 
234 private:
235  vtkImageHistogram(const vtkImageHistogram&) = delete;
236  void operator=(const vtkImageHistogram&) = delete;
237 
238  friend class vtkImageHistogramFunctor;
239 };
240 
241 #endif
vtkImageHistogram::BinSpacing
double BinSpacing
Definition: vtkImageHistogram.h:223
vtkImageHistogram::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkImageHistogram::BinOrigin
double BinOrigin
Definition: vtkImageHistogram.h:222
vtkImageHistogram::GenerateHistogramImage
vtkTypeBool GenerateHistogramImage
Definition: vtkImageHistogram.h:219
vtkImageHistogram
Compute the histogram for an image.
Definition: vtkImageHistogram.h:43
vtkImageHistogram::Log
@ Log
Definition: vtkImageHistogram.h:56
vtkImageHistogram::ThreadData
vtkImageHistogramThreadData * ThreadData
Definition: vtkImageHistogram.h:229
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkImageHistogram::ComputeImageScalarRange
void ComputeImageScalarRange(vtkImageData *data, double range[2])
Compute the range of the data.
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkImageHistogram::vtkImageHistogram
vtkImageHistogram()
vtkImageHistogram::GetTotal
vtkIdType GetTotal()
Get the total count of the histogram.
Definition: vtkImageHistogram.h:183
vtkImageHistogram::SMPThreadData
vtkImageHistogramSMPThreadLocal * SMPThreadData
Definition: vtkImageHistogram.h:232
vtkImageHistogram::Histogram
vtkIdTypeArray * Histogram
Definition: vtkImageHistogram.h:225
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:39
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()
Set the scale to use for the histogram image.
Definition: vtkImageHistogram.h:168
vtkThreadedImageAlgorithm.h
vtkImageHistogram::Total
vtkIdType Total
Definition: vtkImageHistogram.h:226
vtkImageHistogram::SetStencilData
void SetStencilData(vtkImageStencilData *stencil)
Use a stencil to compute the histogram for just a part of the image.
vtkImageHistogram::GetStencil
vtkImageStencilData * GetStencil()
Use a stencil to compute the histogram for just a part of the image.
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:453
vtkImageHistogram::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo)) override
vtkImageHistogram::NumberOfBins
int NumberOfBins
Definition: vtkImageHistogram.h:221
vtkImageHistogram::Linear
@ Linear
Definition: vtkImageHistogram.h:55
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:48
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkImageHistogram::AutomaticBinning
vtkTypeBool AutomaticBinning
Definition: vtkImageHistogram.h:214
vtkImageHistogram::MaximumNumberOfBins
int MaximumNumberOfBins
Definition: vtkImageHistogram.h:215
vtkImageHistogram::HistogramImageScale
int HistogramImageScale
Definition: vtkImageHistogram.h:218
vtkImageHistogram::GetHistogramImageScaleAsString
const char * GetHistogramImageScaleAsString()
Set the scale to use for the histogram image.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:74
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkImageHistogram::SetStencilConnection
void SetStencilConnection(vtkAlgorithmOutput *algOutput)
Equivalent to SetInputConnection(1, algOutput).
vtkImageHistogram::SetHistogramImageScaleToLog
void SetHistogramImageScaleToLog()
Set the scale to use for the histogram image.
Definition: vtkImageHistogram.h:167
vtkImageHistogram::SetHistogramImageScaleToLinear
void SetHistogramImageScaleToLinear()
Set the scale to use for the histogram image.
Definition: vtkImageHistogram.h:166
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:36
vtkImageHistogram::ActiveComponent
int ActiveComponent
Definition: vtkImageHistogram.h:213
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:37
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:34
vtkImageHistogram::New
static vtkImageHistogram * New()
vtkImageHistogram::GetHistogram
vtkIdTypeArray * GetHistogram()
Get the histogram as a vtkIdTypeArray.
vtkImageHistogram::Sqrt
@ Sqrt
Definition: vtkImageHistogram.h:57
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69