VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 -------------------------------------------------------------------------*/
47 #ifndef __vtkExtractHistogram2D_h
48 #define __vtkExtractHistogram2D_h
49 
50 #include "vtkFiltersImagingModule.h" // For export macro
51 #include "vtkStatisticsAlgorithm.h"
52 
53 class vtkImageData;
54 class vtkIdTypeArray;
55 class vtkMultiBlockDataSet;
56 
57 class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
58 {
59 public:
60  static vtkExtractHistogram2D* New();
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
64 //BTX
66  {
67  HISTOGRAM_IMAGE=3
68  };
69 //ETX
70 
72 
73  vtkSetVector2Macro(NumberOfBins,int);
74  vtkGetVector2Macro(NumberOfBins,int);
76 
78 
80  vtkSetVector2Macro(ComponentsToProcess,int);
81  vtkGetVector2Macro(ComponentsToProcess,int);
83 
85 
88  vtkSetVector4Macro(CustomHistogramExtents,double);
89  vtkGetVector4Macro(CustomHistogramExtents,double);
91 
93 
95  vtkSetMacro(UseCustomHistogramExtents,int);
96  vtkGetMacro(UseCustomHistogramExtents,int);
97  vtkBooleanMacro(UseCustomHistogramExtents,int);
99 
101 
104  vtkSetMacro(ScalarType,int);
106  {this->SetScalarType(VTK_UNSIGNED_INT);};
108  {this->SetScalarType(VTK_UNSIGNED_LONG);};
110  {this->SetScalarType(VTK_UNSIGNED_SHORT);};
112  {this->SetScalarType(VTK_UNSIGNED_CHAR);};
114  {this->SetScalarType(VTK_FLOAT);};
116  {this->SetScalarType(VTK_DOUBLE);};
117  vtkGetMacro(ScalarType,int);
119 
121 
123  vtkGetMacro(MaximumBinCount,double);
125 
128  int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
129 
132  int GetBinRange(vtkIdType bin, double range[4]);
133 
136  void GetBinWidth(double bw[2]);
137 
140  vtkImageData* GetOutputHistogramImage();
141 
144  double* GetHistogramExtents();
145 
146  vtkSetMacro(SwapColumns,int);
147  vtkGetMacro(SwapColumns,int);
148  vtkBooleanMacro(SwapColumns,int);
149 
151 
152  virtual void SetRowMask(vtkDataArray*);
153  vtkGetObjectMacro(RowMask,vtkDataArray);
155 
157  virtual void Aggregate( vtkDataObjectCollection*, vtkMultiBlockDataSet* ) {};
158 
159 protected:
162 
164  int NumberOfBins[2];
165  double HistogramExtents[4];
166  double CustomHistogramExtents[4];
168  int ComponentsToProcess[2];
171  vtkDataArray* RowMask;
172 
173  virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
174 
176 
178  virtual void Learn( vtkTable* inData,
179  vtkTable* inParameters,
180  vtkMultiBlockDataSet* inMeta );
182 
184  virtual void Derive( vtkMultiBlockDataSet* ) {};
185 
187 
188  virtual void Test( vtkTable*,
189  vtkMultiBlockDataSet*,
190  vtkTable* ) { return; };
192 
194 
195  virtual void Assess( vtkTable*,
196  vtkMultiBlockDataSet*,
197  vtkTable* ) { return; };
199 
201 
202  virtual void SelectAssessFunctor( vtkTable* vtkNotUsed(outData),
203  vtkDataObject* vtkNotUsed(inMeta),
204  vtkStringArray* vtkNotUsed(rowNames),
205  AssessFunctor*& vtkNotUsed(dfunc) ) {};
207 
208  virtual int FillOutputPortInformation( int port, vtkInformation* info );
209 
211 
213  virtual int RequestInformation (vtkInformation *request,
214  vtkInformationVector **inputVector,
215  vtkInformationVector *outputVector);
217 
219 
220  int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
221 private:
222  vtkExtractHistogram2D(const vtkExtractHistogram2D&); // Not implemented
223  void operator=(const vtkExtractHistogram2D&); // Not implemented
224 };
226 
227 #endif
void PrintSelf(ostream &os, vtkIndent indent)
Base class for statistics algorithms.
virtual void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *)
compute a 2D histogram between two columns of an input vtkTable.
virtual void SelectAssessFunctor(vtkTable *vtkNotUsed(outData), vtkDataObject *vtkNotUsed(inMeta), vtkStringArray *vtkNotUsed(rowNames), AssessFunctor *&vtkNotUsed(dfunc))
virtual void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *)
virtual void Derive(vtkMultiBlockDataSet *)
virtual void Learn(vtkTable *, vtkTable *, vtkMultiBlockDataSet *)=0
virtual void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *)
virtual int FillOutputPortInformation(int port, vtkInformation *info)