00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00047 #ifndef __vtkExtractHistogram2D_h
00048 #define __vtkExtractHistogram2D_h
00049
00050 #include "vtkBivariateStatisticsAlgorithm.h"
00051
00052 class vtkImageData;
00053 class vtkIdTypeArray;
00054
00055 class VTK_INFOVIS_EXPORT vtkExtractHistogram2D : public vtkBivariateStatisticsAlgorithm
00056 {
00057 public:
00058 static vtkExtractHistogram2D* New();
00059 vtkTypeMacro(vtkExtractHistogram2D, vtkBivariateStatisticsAlgorithm);
00060 void PrintSelf(ostream& os, vtkIndent indent);
00061
00062
00063 enum OutputIndices
00064 {
00065 HISTOGRAM_IMAGE=3
00066 };
00067
00068
00070
00071 vtkSetVector2Macro(NumberOfBins,int);
00072 vtkGetVector2Macro(NumberOfBins,int);
00074
00076
00078 vtkSetVector2Macro(ComponentsToProcess,int);
00079 vtkGetVector2Macro(ComponentsToProcess,int);
00081
00083
00086 vtkSetVector4Macro(CustomHistogramExtents,double);
00087 vtkGetVector4Macro(CustomHistogramExtents,double);
00089
00091
00093 vtkSetMacro(UseCustomHistogramExtents,int);
00094 vtkGetMacro(UseCustomHistogramExtents,int);
00095 vtkBooleanMacro(UseCustomHistogramExtents,int);
00097
00099
00102 vtkSetMacro(ScalarType,int);
00103 void SetScalarTypeToUnsignedInt()
00104 {this->SetScalarType(VTK_UNSIGNED_INT);};
00105 void SetScalarTypeToUnsignedLong()
00106 {this->SetScalarType(VTK_UNSIGNED_LONG);};
00107 void SetScalarTypeToUnsignedShort()
00108 {this->SetScalarType(VTK_UNSIGNED_SHORT);};
00109 void SetScalarTypeToUnsignedChar()
00110 {this->SetScalarType(VTK_UNSIGNED_CHAR);};
00111 void SetScalarTypeToFloat()
00112 {this->SetScalarType(VTK_FLOAT);};
00113 void SetScalarTypeToDouble()
00114 {this->SetScalarType(VTK_DOUBLE);};
00115 vtkGetMacro(ScalarType,int);
00117
00119
00121 vtkGetMacro(MaximumBinCount,double);
00123
00126 int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
00127
00130 int GetBinRange(vtkIdType bin, double range[4]);
00131
00134 void GetBinWidth(double bw[2]);
00135
00138 vtkImageData* GetOutputHistogramImage();
00139
00142 double* GetHistogramExtents();
00143
00144 vtkSetMacro(SwapColumns,int);
00145 vtkGetMacro(SwapColumns,int);
00146 vtkBooleanMacro(SwapColumns,int);
00147
00149
00150 virtual void SetRowMask(vtkDataArray*);
00151 vtkGetObjectMacro(RowMask,vtkDataArray);
00153
00155 virtual void Aggregate( vtkDataObjectCollection*, vtkDataObject* ) {};
00156
00157 protected:
00158 vtkExtractHistogram2D();
00159 ~vtkExtractHistogram2D();
00160
00161 int SwapColumns;
00162 int NumberOfBins[2];
00163 double HistogramExtents[4];
00164 double CustomHistogramExtents[4];
00165 int UseCustomHistogramExtents;
00166 int ComponentsToProcess[2];
00167 double MaximumBinCount;
00168 int ScalarType;
00169 vtkDataArray* RowMask;
00170
00171 virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
00172
00174
00176 virtual void Learn( vtkTable* inData,
00177 vtkTable* inParameters,
00178 vtkDataObject* outMeta );
00180
00182 virtual void Derive( vtkDataObject* ) {};
00183
00185
00186 virtual void Test( vtkTable*,
00187 vtkDataObject*,
00188 vtkDataObject* ) { return; };
00190
00192
00193 virtual void SelectAssessFunctor( vtkTable* vtkNotUsed(outData),
00194 vtkDataObject* vtkNotUsed(inMeta),
00195 vtkStringArray* vtkNotUsed(rowNames),
00196 AssessFunctor*& vtkNotUsed(dfunc) ) {};
00198
00199 virtual int FillOutputPortInformation( int port, vtkInformation* info );
00200
00202
00204 virtual int RequestInformation (vtkInformation *request,
00205 vtkInformationVector **inputVector,
00206 vtkInformationVector *outputVector);
00208
00210 int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
00211 private:
00212 vtkExtractHistogram2D(const vtkExtractHistogram2D&);
00213 void operator=(const vtkExtractHistogram2D&);
00214 };
00215
00216 #endif