VTK
vtkExtractHistogram2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractHistogram2D.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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2011 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
48 #ifndef vtkExtractHistogram2D_h
49 #define vtkExtractHistogram2D_h
50 
51 #include "vtkFiltersImagingModule.h" // For export macro
52 #include "vtkStatisticsAlgorithm.h"
53 
54 class vtkImageData;
55 class vtkIdTypeArray;
57 
58 class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
59 {
60 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
66  {
67  HISTOGRAM_IMAGE=3
68  };
69 
71 
74  vtkSetVector2Macro(NumberOfBins,int);
75  vtkGetVector2Macro(NumberOfBins,int);
77 
79 
83  vtkSetVector2Macro(ComponentsToProcess,int);
84  vtkGetVector2Macro(ComponentsToProcess,int);
86 
88 
92  vtkSetVector4Macro(CustomHistogramExtents,double);
93  vtkGetVector4Macro(CustomHistogramExtents,double);
95 
97 
101  vtkSetMacro(UseCustomHistogramExtents,int);
102  vtkGetMacro(UseCustomHistogramExtents,int);
103  vtkBooleanMacro(UseCustomHistogramExtents,int);
105 
107 
112  vtkSetMacro(ScalarType,int);
114  {this->SetScalarType(VTK_UNSIGNED_INT);};
116  {this->SetScalarType(VTK_UNSIGNED_LONG);};
118  {this->SetScalarType(VTK_UNSIGNED_SHORT);};
120  {this->SetScalarType(VTK_UNSIGNED_CHAR);};
122  {this->SetScalarType(VTK_FLOAT);};
124  {this->SetScalarType(VTK_DOUBLE);};
125  vtkGetMacro(ScalarType,int);
127 
129 
133  vtkGetMacro(MaximumBinCount,double);
135 
140  int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
141 
146  int GetBinRange(vtkIdType bin, double range[4]);
147 
152  void GetBinWidth(double bw[2]);
153 
159 
165 
166  vtkSetMacro(SwapColumns,int);
167  vtkGetMacro(SwapColumns,int);
168  vtkBooleanMacro(SwapColumns,int);
169 
171 
174  virtual void SetRowMask(vtkDataArray*);
175  vtkGetObjectMacro(RowMask,vtkDataArray);
177 
182 
183 protected:
186 
188  int NumberOfBins[2];
189  double HistogramExtents[4];
190  double CustomHistogramExtents[4];
192  int ComponentsToProcess[2];
196 
197  virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
198 
203  virtual void Learn( vtkTable* inData,
204  vtkTable* inParameters,
205  vtkMultiBlockDataSet* inMeta );
206 
210  virtual void Derive( vtkMultiBlockDataSet* ) {}
211 
215  virtual void Test( vtkTable*,
217  vtkTable* ) { return; };
218 
222  virtual void Assess( vtkTable*,
224  vtkTable* ) { return; };
225 
229  virtual void SelectAssessFunctor( vtkTable* vtkNotUsed(outData),
230  vtkDataObject* vtkNotUsed(inMeta),
231  vtkStringArray* vtkNotUsed(rowNames),
232  AssessFunctor*& vtkNotUsed(dfunc) ) {}
233 
235 
239  virtual int RequestInformation (vtkInformation *request,
240  vtkInformationVector **inputVector,
241  vtkInformationVector *outputVector);
242 
247 
248 private:
249  vtkExtractHistogram2D(const vtkExtractHistogram2D&) VTK_DELETE_FUNCTION;
250  void operator=(const vtkExtractHistogram2D&) VTK_DELETE_FUNCTION;
251 };
252 
253 #endif
vtkStatisticsAlgorithm.h
vtkExtractHistogram2D::Derive
virtual void Derive(vtkMultiBlockDataSet *)
Execute the calculations required by the Derive option.
Definition: vtkExtractHistogram2D.h:210
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkDataObjectCollection
maintain an unordered list of data objects
Definition: vtkDataObjectCollection.h:35
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
vtkExtractHistogram2D::Test
virtual void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *)
Execute the calculations required by the Test option.
Definition: vtkExtractHistogram2D.h:215
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkExtractHistogram2D::SetRowMask
virtual void SetRowMask(vtkDataArray *)
Get/Set an optional mask that can ignore rows of the table.
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkExtractHistogram2D::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkExtractHistogram2D::Learn
virtual void Learn(vtkTable *inData, vtkTable *inParameters, vtkMultiBlockDataSet *inMeta)
Execute the calculations required by the Learn option.
vtkExtractHistogram2D::UseCustomHistogramExtents
int UseCustomHistogramExtents
Definition: vtkExtractHistogram2D.h:191
vtkStatisticsAlgorithm::AssessFunctor
A base class for a functor that assesses data.
Definition: vtkStatisticsAlgorithm.h:183
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:52
vtkExtractHistogram2D::SetScalarTypeToUnsignedInt
void SetScalarTypeToUnsignedInt()
Definition: vtkExtractHistogram2D.h:113
vtkExtractHistogram2D::Assess
virtual void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *)
Execute the calculations required by the Assess option.
Definition: vtkExtractHistogram2D.h:222
vtkExtractHistogram2D::GetOutputHistogramImage
vtkImageData * GetOutputHistogramImage()
Gets the data object at the histogram image output port and casts it to a vtkImageData.
vtkExtractHistogram2D::vtkExtractHistogram2D
vtkExtractHistogram2D()
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkExtractHistogram2D::SetScalarTypeToUnsignedChar
void SetScalarTypeToUnsignedChar()
Definition: vtkExtractHistogram2D.h:119
vtkExtractHistogram2D::SetScalarTypeToUnsignedShort
void SetScalarTypeToUnsignedShort()
Definition: vtkExtractHistogram2D.h:117
vtkExtractHistogram2D
compute a 2D histogram between two columns of an input vtkTable.
Definition: vtkExtractHistogram2D.h:59
vtkExtractHistogram2D::OutputIndices
OutputIndices
Definition: vtkExtractHistogram2D.h:66
vtkExtractHistogram2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkExtractHistogram2D::GetBinRange
int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4])
Compute the range of the bin located at position (binX,binY) in the 2D histogram.
vtkExtractHistogram2D::GetInputArrays
int GetInputArrays(vtkDataArray *&col1, vtkDataArray *&col2)
Get points to the arrays that live in the two input columns.
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
vtkExtractHistogram2D::GetBinRange
int GetBinRange(vtkIdType bin, double range[4])
Get the range of the of the bin located at 1D position index bin in the 2D histogram array.
vtkExtractHistogram2D::SetScalarTypeToDouble
void SetScalarTypeToDouble()
Definition: vtkExtractHistogram2D.h:123
vtkExtractHistogram2D::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Makes sure that the image data output port has up-to-date spacing/origin/etc.
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkExtractHistogram2D::GetBinWidth
void GetBinWidth(double bw[2])
Get the width of all of the bins.
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkExtractHistogram2D::GetHistogramExtents
double * GetHistogramExtents()
Get the histogram extents currently in use, either computed or set by the user.
vtkExtractHistogram2D::SwapColumns
int SwapColumns
Definition: vtkExtractHistogram2D.h:187
vtkExtractHistogram2D::SetScalarTypeToUnsignedLong
void SetScalarTypeToUnsignedLong()
Definition: vtkExtractHistogram2D.h:115
vtkExtractHistogram2D::ScalarType
int ScalarType
Definition: vtkExtractHistogram2D.h:194
vtkExtractHistogram2D::~vtkExtractHistogram2D
~vtkExtractHistogram2D()
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:43
vtkExtractHistogram2D::RowMask
vtkDataArray * RowMask
Definition: vtkExtractHistogram2D.h:195
vtkStatisticsAlgorithm
Base class for statistics algorithms.
Definition: vtkStatisticsAlgorithm.h:78
vtkExtractHistogram2D::SetScalarTypeToFloat
void SetScalarTypeToFloat()
Definition: vtkExtractHistogram2D.h:121
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkExtractHistogram2D::MaximumBinCount
double MaximumBinCount
Definition: vtkExtractHistogram2D.h:193
vtkExtractHistogram2D::New
static vtkExtractHistogram2D * New()
vtkExtractHistogram2D::ComputeBinExtents
virtual int ComputeBinExtents(vtkDataArray *col1, vtkDataArray *col2)
vtkExtractHistogram2D::SelectAssessFunctor
virtual void SelectAssessFunctor(vtkTable *vtkNotUsed(outData), vtkDataObject *vtkNotUsed(inMeta), vtkStringArray *vtkNotUsed(rowNames), AssessFunctor *&vtkNotUsed(dfunc))
Provide the appropriate assessment functor.
Definition: vtkExtractHistogram2D.h:229
vtkExtractHistogram2D::Aggregate
virtual void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *)
Given a collection of models, calculate aggregate model.
Definition: vtkExtractHistogram2D.h:181