VTK  9.7.1
vtkPairwiseExtractHistogram2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
27 #ifndef vtkPairwiseExtractHistogram2D_h
28 #define vtkPairwiseExtractHistogram2D_h
29 
30 #include "vtkFiltersImagingModule.h" // For export macro
31 #include "vtkSmartPointer.h" //needed for smart pointer ivars
32 #include "vtkStatisticsAlgorithm.h"
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkCollection;
36 class vtkImageData;
37 class vtkIdTypeArray;
38 
39 class VTKFILTERSIMAGING_EXPORT vtkPairwiseExtractHistogram2D : public vtkStatisticsAlgorithm
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47  int GetMaximumNumberOfColumnsPerRequest() const override { return 2; }
48 
50 
53  vtkSetVector2Macro(NumberOfBins, int);
54  vtkGetVector2Macro(NumberOfBins, int);
56 
58 
63  vtkSetMacro(CustomColumnRangeIndex, int);
64  void SetCustomColumnRangeByIndex(double, double);
66 
68 
73  void SetCustomColumnRange(int col, double range[2]);
74  void SetCustomColumnRange(int col, double rmin, double rmax);
76 
78 
81  vtkSetMacro(ScalarType, int);
82  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
83  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
84  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
85  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
86  vtkGetMacro(ScalarType, int);
88 
92  double GetMaximumBinCount(int idx);
93 
97  double GetMaximumBinCount();
98 
103  int GetBinRange(int idx, vtkIdType binX, vtkIdType binY, double range[4]);
104 
109  int GetBinRange(int idx, vtkIdType bin, double range[4]);
110 
115  void GetBinWidth(int idx, double bw[2]);
116 
121  double* GetHistogramExtents(int idx);
122 
126  vtkImageData* GetOutputHistogramImage(int idx);
127 
131  vtkExtractHistogram2D* GetHistogramFilter(int idx);
132 
134  {
135  HISTOGRAM_IMAGE = 3
136  };
137 
141  bool Aggregate(vtkDataObjectCollection*, vtkStatisticalModel*) override { return false; }
142 
143 protected:
145  ~vtkPairwiseExtractHistogram2D() override;
146 
147  int NumberOfBins[2];
150 
153  class Internals;
154  Internals* Implementation;
155 
160  void Learn(vtkTable* inData, vtkTable* inParameters, vtkStatisticalModel* outMeta) override;
161 
165  void Derive(vtkStatisticalModel*) override {}
166 
171 
175  void Test(vtkTable*, vtkStatisticalModel*, vtkTable*) override {}
176 
180  void SelectAssessFunctor(vtkTable* vtkNotUsed(outData), vtkDataObject* vtkNotUsed(inMeta),
181  vtkStringArray* vtkNotUsed(rowNames), AssessFunctor*& vtkNotUsed(dfunc)) override
182  {
183  }
184 
188  virtual vtkExtractHistogram2D* NewHistogramFilter();
189 
191 
193 
194 private:
196  void operator=(const vtkPairwiseExtractHistogram2D&) = delete;
197 };
198 
199 VTK_ABI_NAMESPACE_END
200 #endif
void Derive(vtkStatisticalModel *) override
Execute the calculations required by the Derive option.
A base class for a functor that assesses data.
int GetMaximumNumberOfColumnsPerRequest() const override
This filter requires bivariate requests.
#define VTK_UNSIGNED_INT
Definition: vtkType.h:40
a base class for statistical modeling of other data
vtkSmartPointer< vtkCollection > HistogramFilters
vtkSmartPointer< vtkIdTypeArray > OutputOutlierIds
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:38
maintain an unordered list of data objects
record modification and/or execution time
Definition: vtkTimeStamp.h:24
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:363
virtual void Learn(vtkTable *, vtkTable *, vtkStatisticalModel *)=0
Execute the calculations required by the Learn option, given some input Data.
void SetScalarTypeToUnsignedLong()
Set the scalar type for each of the computed histograms.
Base class for statistics algorithms.
a simple class to control print indentation
Definition: vtkIndent.h:28
compute a 2D histogram between two columns of an input vtkTable.
bool Aggregate(vtkDataObjectCollection *, vtkStatisticalModel *) override
Given a collection of models, calculate aggregate model.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
void SelectAssessFunctor(vtkTable *outData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
void Assess(vtkTable *, vtkStatisticalModel *, vtkTable *) override
Execute the assess option.
void Test(vtkTable *, vtkStatisticalModel *, vtkTable *) override
Execute the calculations required by the Test option.
void SetScalarTypeToUnsignedChar()
Set the scalar type for each of the computed histograms.
void SetScalarTypeToUnsignedInt()
Set the scalar type for each of the computed histograms.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:36
create and manipulate ordered lists of objects
Definition: vtkCollection.h:39
int FillOutputPortInformation(int port, vtkInformation *info) override
Return a new instance of a subclass named and configured by the algorithmParameters.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:42
void SetScalarTypeToUnsignedShort()
Set the scalar type for each of the computed histograms.
general representation of visualization data
Definition: vtkDataObject.h:55
compute a 2D histogram between all adjacent columns of an input vtkTable.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.