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);
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, int);
88  vtkBooleanMacro(AutomaticBinning, int);
89  vtkGetMacro(AutomaticBinning, int);
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, int);
152  vtkBooleanMacro(GenerateHistogramImage, int);
153  vtkGetMacro(GenerateHistogramImage, int);
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 
198  virtual void ThreadedRequestData(vtkInformation *request,
199  vtkInformationVector **inputVector,
200  vtkInformationVector *outputVector,
201  vtkImageData ***inData,
202  vtkImageData **outData, int ext[6], int id);
203 
204 protected:
207 
208  virtual int RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
209  vtkInformationVector **inInfo,
210  vtkInformationVector *vtkNotUsed(outInfo));
211  virtual int RequestInformation(vtkInformation *vtkNotUsed(request),
212  vtkInformationVector **inInfo,
213  vtkInformationVector *vtkNotUsed(outInfo));
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&) VTK_DELETE_FUNCTION;
251  void operator=(const vtkImageHistogram&) VTK_DELETE_FUNCTION;
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
Definition: vtkImageData.h:46
Compute the histogram for an image.
void SetStencilData(vtkImageStencilData *stencil)
Use a stencil to compute the histogram for just a part of the image.
void SetHistogramImageScaleToLog()
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
virtual int RequestInformation(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo))
vtkImageHistogramThreadData * ThreadData
void ComputeImageScalarRange(vtkImageData *data, double range[2])
Compute the range of the data.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetHistogramImageScaleToLinear()
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id)
This is part of the executive, but is public so that it can be accessed by non-member functions.
void SetStencilConnection(vtkAlgorithmOutput *algOutput)
Equivalent to SetInputConnection(1, algOutput).
static vtkImageHistogram * New()
vtkImageHistogramSMPThreadLocal * SMPThreadData
virtual int RequestUpdateExtent(vtkInformation *vtkNotUsed(request), vtkInformationVector **inInfo, vtkInformationVector *vtkNotUsed(outInfo))
virtual int FillOutputPortInformation(int port, vtkInformation *info)
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void SetHistogramImageScaleToSqrt()
const char * GetHistogramImageScaleAsString()
vtkIdTypeArray * Histogram
vtkIdTypeArray * GetHistogram()
Get the histogram as a vtkIdTypeArray.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkIdType GetTotal()
Get the total count of the histogram.
vtkImageStencilData * GetStencil()
efficient description of an image stencil
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
@ data
Definition: vtkX3D.h:315
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287