VTK  9.3.1
vtkExtractHistogram2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2011 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
32 #ifndef vtkExtractHistogram2D_h
33 #define vtkExtractHistogram2D_h
34 
35 #include "vtkFiltersImagingModule.h" // For export macro
36 #include "vtkStatisticsAlgorithm.h"
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkImageData;
41 class vtkIdTypeArray;
43 
44 class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
45 {
46 public:
47  static vtkExtractHistogram2D* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52  {
53  HISTOGRAM_IMAGE = 3
54  };
55 
57 
60  vtkSetVector2Macro(NumberOfBins, int);
61  vtkGetVector2Macro(NumberOfBins, int);
63 
65 
69  vtkSetVector2Macro(ComponentsToProcess, int);
70  vtkGetVector2Macro(ComponentsToProcess, int);
72 
74 
78  vtkSetVector4Macro(CustomHistogramExtents, double);
79  vtkGetVector4Macro(CustomHistogramExtents, double);
81 
83 
87  vtkSetMacro(UseCustomHistogramExtents, vtkTypeBool);
88  vtkGetMacro(UseCustomHistogramExtents, vtkTypeBool);
89  vtkBooleanMacro(UseCustomHistogramExtents, vtkTypeBool);
91 
93 
98  vtkSetMacro(ScalarType, int);
99  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
100  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
101  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
102  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
103  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
104  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
105  vtkGetMacro(ScalarType, int);
107 
109 
113  vtkGetMacro(MaximumBinCount, double);
115 
120  int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
121 
126  int GetBinRange(vtkIdType bin, double range[4]);
127 
132  void GetBinWidth(double bw[2]);
133 
138  vtkImageData* GetOutputHistogramImage();
139 
144  double* GetHistogramExtents();
145 
146  vtkSetMacro(SwapColumns, vtkTypeBool);
147  vtkGetMacro(SwapColumns, vtkTypeBool);
148  vtkBooleanMacro(SwapColumns, vtkTypeBool);
149 
151 
154  virtual void SetRowMask(vtkDataArray*);
155  vtkGetObjectMacro(RowMask, vtkDataArray);
157 
162 
163 protected:
165  ~vtkExtractHistogram2D() override;
166 
168  int NumberOfBins[2];
169  double HistogramExtents[4];
170  double CustomHistogramExtents[4];
172  int ComponentsToProcess[2];
176 
177  virtual int ComputeBinExtents(vtkDataSetAttributes* dsa, vtkDataArray* col1, vtkDataArray* col2);
178 
183  void Learn(vtkTable* inData, vtkTable* inParameters, vtkMultiBlockDataSet* outMeta) override;
184 
188  void Derive(vtkMultiBlockDataSet*) override {}
189 
194 
199 
203  void SelectAssessFunctor(vtkTable* vtkNotUsed(outData), vtkDataObject* vtkNotUsed(inMeta),
204  vtkStringArray* vtkNotUsed(rowNames), AssessFunctor*& vtkNotUsed(dfunc)) override
205  {
206  }
207 
209 
213  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
214  vtkInformationVector* outputVector) override;
215 
219  int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
220 
221 private:
223  void operator=(const vtkExtractHistogram2D&) = delete;
224 };
225 
226 VTK_ABI_NAMESPACE_END
227 #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:39
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
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:315
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:64
Base class for statistics algorithms.
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_FLOAT
Definition: vtkType.h:42
a simple class to control print indentation
Definition: vtkIndent.h:28
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:42
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
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:58
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
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:41
general representation of visualization data
Definition: vtkDataObject.h:54
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.