VTK  9.0.1
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);
113  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
114  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
115  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
116  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
117  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
118  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
119  vtkGetMacro(ScalarType, int);
121 
123 
127  vtkGetMacro(MaximumBinCount, double);
129 
134  int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
135 
140  int GetBinRange(vtkIdType bin, double range[4]);
141 
146  void GetBinWidth(double bw[2]);
147 
152  vtkImageData* GetOutputHistogramImage();
153 
158  double* GetHistogramExtents();
159 
160  vtkSetMacro(SwapColumns, vtkTypeBool);
161  vtkGetMacro(SwapColumns, vtkTypeBool);
162  vtkBooleanMacro(SwapColumns, vtkTypeBool);
163 
165 
168  virtual void SetRowMask(vtkDataArray*);
169  vtkGetObjectMacro(RowMask, vtkDataArray);
171 
176 
177 protected:
179  ~vtkExtractHistogram2D() override;
180 
182  int NumberOfBins[2];
183  double HistogramExtents[4];
184  double CustomHistogramExtents[4];
186  int ComponentsToProcess[2];
190 
191  virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
192 
197  void Learn(vtkTable* inData, vtkTable* inParameters, vtkMultiBlockDataSet* inMeta) override;
198 
202  void Derive(vtkMultiBlockDataSet*) override {}
203 
207  void Test(vtkTable*, vtkMultiBlockDataSet*, vtkTable*) override { return; }
208 
212  void Assess(vtkTable*, vtkMultiBlockDataSet*, vtkTable*) override { return; }
213 
217  void SelectAssessFunctor(vtkTable* vtkNotUsed(outData), vtkDataObject* vtkNotUsed(inMeta),
218  vtkStringArray* vtkNotUsed(rowNames), AssessFunctor*& vtkNotUsed(dfunc)) override
219  {
220  }
221 
223 
227  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
228  vtkInformationVector* outputVector) override;
229 
233  int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
234 
235 private:
237  void operator=(const vtkExtractHistogram2D&) = delete;
238 };
239 
240 #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:49
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:47
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:338
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:53
#define VTK_FLOAT
Definition: vtkType.h:52
a simple class to control print indentation
Definition: vtkIndent.h:33
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:41
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
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:62
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:45
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:51
general representation of visualization data
Definition: vtkDataObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.