VTK  9.3.20240424
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
37
38VTK_ABI_NAMESPACE_BEGIN
40class vtkImageData;
41class vtkIdTypeArray;
43
44class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
45{
46public:
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
139
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
163protected:
166
168 int NumberOfBins[2];
169 double HistogramExtents[4];
170 double CustomHistogramExtents[4];
172 int ComponentsToProcess[2];
176
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
208 int FillOutputPortInformation(int port, vtkInformation* info) override;
209
214 vtkInformationVector* outputVector) override;
215
220
221private:
223 void operator=(const vtkExtractHistogram2D&) = delete;
224};
225
226VTK_ABI_NAMESPACE_END
227#endif
abstract superclass for arrays of numeric data
maintain an unordered list of data objects
general representation of visualization data
represent and manipulate attribute data in a dataset
compute a 2D histogram between two columns of an input vtkTable.
void SetScalarTypeToUnsignedShort()
Control the scalar type of the output histogram.
int GetBinRange(vtkIdType bin, double range[4])
Get the range of the of the bin located at 1D position index bin in the 2D histogram array.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Makes sure that the image data output port has up-to-date spacing/origin/etc.
void SelectAssessFunctor(vtkTable *vtkNotUsed(outData), vtkDataObject *vtkNotUsed(inMeta), vtkStringArray *vtkNotUsed(rowNames), AssessFunctor *&vtkNotUsed(dfunc)) override
Provide the appropriate assessment functor.
void Learn(vtkTable *inData, vtkTable *inParameters, vtkMultiBlockDataSet *outMeta) override
Execute the calculations required by the Learn option.
void SetScalarTypeToDouble()
Control the scalar type of the output histogram.
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output histogram.
~vtkExtractHistogram2D() override
void SetScalarTypeToFloat()
Control the scalar type of the output histogram.
virtual int ComputeBinExtents(vtkDataSetAttributes *dsa, vtkDataArray *col1, vtkDataArray *col2)
void SetScalarTypeToUnsignedLong()
Control the scalar type of the output histogram.
void GetBinWidth(double bw[2])
Get the width of all of the bins.
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
void SetScalarTypeToUnsignedChar()
Control the scalar type of the output histogram.
static vtkExtractHistogram2D * New()
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
virtual void SetRowMask(vtkDataArray *)
Get/Set an optional mask that can ignore rows of the table.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
double * GetHistogramExtents()
Get the histogram extents currently in use, either computed or set by the user.
void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *) override
Given a collection of models, calculate aggregate model.
vtkImageData * GetOutputHistogramImage()
Gets the data object at the histogram image output port and casts it to a vtkImageData.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4])
Compute the range of the bin located at position (binX,binY) in the 2D histogram.
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
int GetInputArrays(vtkDataArray *&col1, vtkDataArray *&col2)
Get points to the arrays that live in the two input columns.
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
A base class for a functor that assesses data.
Base class for statistics algorithms.
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition vtkTable.h:168
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315
#define VTK_UNSIGNED_INT
Definition vtkType.h:39
#define VTK_DOUBLE
Definition vtkType.h:43
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:35
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:37
#define VTK_FLOAT
Definition vtkType.h:42
#define VTK_UNSIGNED_LONG
Definition vtkType.h:41