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:
61  static vtkExtractHistogram2D* New();
63  void PrintSelf(ostream& os, vtkIndent indent) override;
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,vtkTypeBool);
102  vtkGetMacro(UseCustomHistogramExtents,vtkTypeBool);
103  vtkBooleanMacro(UseCustomHistogramExtents,vtkTypeBool);
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 
158  vtkImageData* GetOutputHistogramImage();
159 
164  double* GetHistogramExtents();
165 
166  vtkSetMacro(SwapColumns,vtkTypeBool);
167  vtkGetMacro(SwapColumns,vtkTypeBool);
168  vtkBooleanMacro(SwapColumns,vtkTypeBool);
169 
171 
174  virtual void SetRowMask(vtkDataArray*);
175  vtkGetObjectMacro(RowMask,vtkDataArray);
177 
182 
183 protected:
185  ~vtkExtractHistogram2D() override;
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  void Learn( vtkTable* inData,
204  vtkTable* inParameters,
205  vtkMultiBlockDataSet* inMeta ) override;
206 
210  void Derive( vtkMultiBlockDataSet* ) override {}
211 
215  void Test( vtkTable*,
217  vtkTable* ) override { return; };
218 
222  void Assess( vtkTable*,
224  vtkTable* ) override { return; };
225 
229  void SelectAssessFunctor( vtkTable* vtkNotUsed(outData),
230  vtkDataObject* vtkNotUsed(inMeta),
231  vtkStringArray* vtkNotUsed(rowNames),
232  AssessFunctor*& vtkNotUsed(dfunc) ) override {}
233 
234  int FillOutputPortInformation( int port, vtkInformation* info ) override;
235 
239  int RequestInformation (vtkInformation *request,
240  vtkInformationVector **inputVector,
241  vtkInformationVector *outputVector) override;
242 
246  int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
247 
248 private:
250  void operator=(const vtkExtractHistogram2D&) = delete;
251 };
252 
253 #endif
void SetScalarTypeToUnsignedChar()
Control the scalar type of the output histogram.
void SetScalarTypeToDouble()
Control the scalar type of the output histogram.
A base class for a functor that assesses data.
void SetScalarTypeToUnsignedShort()
Control the scalar type of the output histogram.
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
void SelectAssessFunctor(vtkTable *vtkNotUsed(outData), vtkDataObject *vtkNotUsed(inMeta), vtkStringArray *vtkNotUsed(rowNames), AssessFunctor *&vtkNotUsed(dfunc)) override
Provide the appropriate assessment functor.
maintain an unordered list of data objects
void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *) override
Given a collection of models, calculate aggregate model.
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
void SetScalarTypeToUnsignedLong()
Control the scalar type of the output histogram.
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output histogram.
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
int vtkTypeBool
Definition: vtkABI.h:69
Base class for statistics algorithms.
#define VTK_DOUBLE
Definition: vtkType.h:59
#define VTK_FLOAT
Definition: vtkType.h:58
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetScalarTypeToFloat()
Control the scalar type of the output histogram.
compute a 2D histogram between two columns of an input vtkTable.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual void Learn(vtkTable *, vtkTable *, vtkMultiBlockDataSet *)=0
Execute the calculations required by the Learn option, given some input Data.
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
Composite dataset that organizes datasets into blocks.
Store zero or more vtkInformation instances.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
general representation of visualization data
Definition: vtkDataObject.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.