VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkExtractHistogram2D.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2009 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 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 //BTX 00063 enum OutputIndices 00064 { 00065 HISTOGRAM_IMAGE=3 00066 }; 00067 //ETX 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&); // Not implemented 00213 void operator=(const vtkExtractHistogram2D&); // Not implemented 00214 }; 00215 00216 #endif