VTK  9.5.20251216
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
31
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;
42
43class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
44{
45public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51 int GetMaximumNumberOfColumnsPerRequest() const override { return 2; }
52
54 {
56 };
57
59
62 vtkSetVector2Macro(NumberOfBins, int);
63 vtkGetVector2Macro(NumberOfBins, int);
65
67
71 vtkSetVector2Macro(ComponentsToProcess, int);
72 vtkGetVector2Macro(ComponentsToProcess, int);
74
76
80 vtkSetVector4Macro(CustomHistogramExtents, double);
81 vtkGetVector4Macro(CustomHistogramExtents, double);
83
85
93
95
100 vtkSetMacro(ScalarType, int);
107 vtkGetMacro(ScalarType, int);
109
111
115 vtkGetMacro(MaximumBinCount, double);
117
122 int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
123
128 int GetBinRange(vtkIdType bin, double range[4]);
129
134 void GetBinWidth(double bw[2]);
135
141
147
150 vtkBooleanMacro(SwapColumns, vtkTypeBool);
151
153
156 virtual void SetRowMask(vtkDataArray*);
157 vtkGetObjectMacro(RowMask, vtkDataArray);
159
163 bool Aggregate(vtkDataObjectCollection*, vtkStatisticalModel*) override { return false; }
164
165protected:
168
178
180
185 void Learn(vtkTable* inData, vtkTable* inParameters, vtkStatisticalModel* outMeta) override;
186
190 void Derive(vtkStatisticalModel*) override {}
191
196
201
205 void SelectAssessFunctor(vtkTable* vtkNotUsed(outData), vtkDataObject* vtkNotUsed(inMeta),
206 vtkStringArray* vtkNotUsed(rowNames), AssessFunctor*& vtkNotUsed(dfunc)) override
207 {
208 }
209
210 int FillOutputPortInformation(int port, vtkInformation* info) override;
211
216 vtkInformationVector* outputVector) override;
217
222
223private:
225 void operator=(const vtkExtractHistogram2D&) = delete;
226};
227
228VTK_ABI_NAMESPACE_END
229#endif
maintain an unordered list of data objects
general representation of visualization data
represent and manipulate attribute data in a dataset
void Assess(vtkTable *, vtkStatisticalModel *, vtkTable *) override
Execute the calculations required by the Assess option.
virtual void SetScalarType(int)
Control the scalar type of the output histogram.
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 *outData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
void Test(vtkTable *, vtkStatisticalModel *, vtkTable *) override
Execute the calculations required by the Test option.
void SetScalarTypeToDouble()
Control the scalar type of the output histogram.
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output histogram.
bool Aggregate(vtkDataObjectCollection *, vtkStatisticalModel *) override
Given a collection of models, calculate aggregate model.
~vtkExtractHistogram2D() override
void Learn(vtkTable *inData, vtkTable *inParameters, vtkStatisticalModel *outMeta) override
Execute the calculations required by the Learn option.
void SetScalarTypeToFloat()
Control the scalar type of the output histogram.
int GetMaximumNumberOfColumnsPerRequest() const override
This filter requires bivariate requests.
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 SetScalarTypeToUnsignedChar()
Control the scalar type of the output histogram.
static vtkExtractHistogram2D * New()
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.
void Derive(vtkStatisticalModel *) override
Execute the calculations required by the Derive option.
double * GetHistogramExtents()
Get the histogram extents currently in use, either computed or set by the user.
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.
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.
a base class for statistical modeling of other data
A base class for a functor that assesses data.
vtkStatisticsAlgorithm()
Return a new instance of a subclass named and configured by the algorithmParameters.
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
int vtkIdType
Definition vtkType.h:368
#define VTK_UNSIGNED_INT
Definition vtkType.h:40
#define VTK_DOUBLE
Definition vtkType.h:44
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:36
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:38
#define VTK_FLOAT
Definition vtkType.h:43
#define VTK_UNSIGNED_LONG
Definition vtkType.h:42