VTK
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
53
54class vtkImageData;
55class vtkIdTypeArray;
57
58class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
59{
60public:
63 void PrintSelf(ostream& os, vtkIndent indent);
64
66 {
67 HISTOGRAM_IMAGE=3
68 };
69
71
74 vtkSetVector2Macro(NumberOfBins,int);
75 vtkGetVector2Macro(NumberOfBins,int);
77
79
83 vtkSetVector2Macro(ComponentsToProcess,int);
84 vtkGetVector2Macro(ComponentsToProcess,int);
86
88
92 vtkSetVector4Macro(CustomHistogramExtents,double);
93 vtkGetVector4Macro(CustomHistogramExtents,double);
95
97
101 vtkSetMacro(UseCustomHistogramExtents,int);
102 vtkGetMacro(UseCustomHistogramExtents,int);
103 vtkBooleanMacro(UseCustomHistogramExtents,int);
105
107
112 vtkSetMacro(ScalarType,int);
114 {this->SetScalarType(VTK_UNSIGNED_INT);};
116 {this->SetScalarType(VTK_UNSIGNED_LONG);};
118 {this->SetScalarType(VTK_UNSIGNED_SHORT);};
120 {this->SetScalarType(VTK_UNSIGNED_CHAR);};
122 {this->SetScalarType(VTK_FLOAT);};
124 {this->SetScalarType(VTK_DOUBLE);};
125 vtkGetMacro(ScalarType,int);
127
129
133 vtkGetMacro(MaximumBinCount,double);
135
140 int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
141
146 int GetBinRange(vtkIdType bin, double range[4]);
147
152 void GetBinWidth(double bw[2]);
153
159
165
166 vtkSetMacro(SwapColumns,int);
167 vtkGetMacro(SwapColumns,int);
168 vtkBooleanMacro(SwapColumns,int);
169
171
174 virtual void SetRowMask(vtkDataArray*);
175 vtkGetObjectMacro(RowMask,vtkDataArray);
177
182
183protected:
186
188 int NumberOfBins[2];
189 double HistogramExtents[4];
190 double CustomHistogramExtents[4];
192 int ComponentsToProcess[2];
196
197 virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
198
203 virtual void Learn( vtkTable* inData,
204 vtkTable* inParameters,
205 vtkMultiBlockDataSet* inMeta );
206
210 virtual void Derive( vtkMultiBlockDataSet* ) {}
211
215 virtual void Test( vtkTable*,
217 vtkTable* ) { return; };
218
222 virtual void Assess( vtkTable*,
224 vtkTable* ) { return; };
225
229 virtual void SelectAssessFunctor( vtkTable* vtkNotUsed(outData),
230 vtkDataObject* vtkNotUsed(inMeta),
231 vtkStringArray* vtkNotUsed(rowNames),
232 AssessFunctor*& vtkNotUsed(dfunc) ) {}
233
235
239 virtual int RequestInformation (vtkInformation *request,
240 vtkInformationVector **inputVector,
241 vtkInformationVector *outputVector);
242
247
248private:
249 vtkExtractHistogram2D(const vtkExtractHistogram2D&) VTK_DELETE_FUNCTION;
250 void operator=(const vtkExtractHistogram2D&) VTK_DELETE_FUNCTION;
251};
252
253#endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
maintain an unordered list of data objects
general representation of visualization data
Definition: vtkDataObject.h:65
compute a 2D histogram between two columns of an input vtkTable.
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.
virtual int ComputeBinExtents(vtkDataArray *col1, vtkDataArray *col2)
virtual void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *)
Execute the calculations required by the Assess option.
virtual void Derive(vtkMultiBlockDataSet *)
Execute the calculations required by the Derive option.
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Makes sure that the image data output port has up-to-date spacing/origin/etc.
void GetBinWidth(double bw[2])
Get the width of all of the bins.
static vtkExtractHistogram2D * New()
virtual void SelectAssessFunctor(vtkTable *vtkNotUsed(outData), vtkDataObject *vtkNotUsed(inMeta), vtkStringArray *vtkNotUsed(rowNames), AssessFunctor *&vtkNotUsed(dfunc))
Provide the appropriate assessment functor.
virtual void SetRowMask(vtkDataArray *)
Get/Set an optional mask that can ignore rows of the table.
virtual void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *)
Execute the calculations required by the Test option.
virtual void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *)
Given a collection of models, calculate aggregate model.
double * GetHistogramExtents()
Get the histogram extents currently in use, either computed or set by the user.
virtual void Learn(vtkTable *inData, vtkTable *inParameters, vtkMultiBlockDataSet *inMeta)
Execute the calculations required by the Learn option.
vtkImageData * GetOutputHistogramImage()
Gets the data object at the histogram image output port and casts it to a vtkImageData.
void PrintSelf(ostream &os, vtkIndent indent)
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
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
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:69
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
#define VTK_DOUBLE
Definition: vtkType.h:59
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
#define VTK_FLOAT
Definition: vtkType.h:58
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57