VTK  9.2.6
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 
55 class vtkImageData;
56 class vtkIdTypeArray;
58 
59 class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
60 {
61 public:
62  static vtkExtractHistogram2D* New();
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67  {
68  HISTOGRAM_IMAGE = 3
69  };
70 
72 
75  vtkSetVector2Macro(NumberOfBins, int);
76  vtkGetVector2Macro(NumberOfBins, int);
78 
80 
84  vtkSetVector2Macro(ComponentsToProcess, int);
85  vtkGetVector2Macro(ComponentsToProcess, int);
87 
89 
93  vtkSetVector4Macro(CustomHistogramExtents, double);
94  vtkGetVector4Macro(CustomHistogramExtents, double);
96 
98 
102  vtkSetMacro(UseCustomHistogramExtents, vtkTypeBool);
103  vtkGetMacro(UseCustomHistogramExtents, vtkTypeBool);
104  vtkBooleanMacro(UseCustomHistogramExtents, vtkTypeBool);
106 
108 
113  vtkSetMacro(ScalarType, int);
114  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
115  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
116  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
117  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
118  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
119  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
120  vtkGetMacro(ScalarType, int);
122 
124 
128  vtkGetMacro(MaximumBinCount, double);
130 
135  int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
136 
141  int GetBinRange(vtkIdType bin, double range[4]);
142 
147  void GetBinWidth(double bw[2]);
148 
153  vtkImageData* GetOutputHistogramImage();
154 
159  double* GetHistogramExtents();
160 
161  vtkSetMacro(SwapColumns, vtkTypeBool);
162  vtkGetMacro(SwapColumns, vtkTypeBool);
163  vtkBooleanMacro(SwapColumns, vtkTypeBool);
164 
166 
169  virtual void SetRowMask(vtkDataArray*);
170  vtkGetObjectMacro(RowMask, vtkDataArray);
172 
177 
178 protected:
180  ~vtkExtractHistogram2D() override;
181 
183  int NumberOfBins[2];
184  double HistogramExtents[4];
185  double CustomHistogramExtents[4];
187  int ComponentsToProcess[2];
191 
192  virtual int ComputeBinExtents(vtkDataSetAttributes* dsa, vtkDataArray* col1, vtkDataArray* col2);
193 
198  void Learn(vtkTable* inData, vtkTable* inParameters, vtkMultiBlockDataSet* outMeta) override;
199 
203  void Derive(vtkMultiBlockDataSet*) override {}
204 
208  void Test(vtkTable*, vtkMultiBlockDataSet*, vtkTable*) override { return; }
209 
213  void Assess(vtkTable*, vtkMultiBlockDataSet*, vtkTable*) override { return; }
214 
218  void SelectAssessFunctor(vtkTable* vtkNotUsed(outData), vtkDataObject* vtkNotUsed(inMeta),
219  vtkStringArray* vtkNotUsed(rowNames), AssessFunctor*& vtkNotUsed(dfunc)) override
220  {
221  }
222 
224 
228  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
229  vtkInformationVector* outputVector) override;
230 
234  int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
235 
236 private:
238  void operator=(const vtkExtractHistogram2D&) = delete;
239 };
240 
241 #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:51
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
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:332
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:55
#define VTK_FLOAT
Definition: vtkType.h:54
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:53
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual void Learn(vtkTable *, vtkTable *, vtkMultiBlockDataSet *)=0
Execute the calculations required by the Learn option, given some input Data.
represent and manipulate attribute data in a dataset
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:73
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
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:53
general representation of visualization data
Definition: vtkDataObject.h:65
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.