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 class vtkMultiBlockDataSet;
00055 
00056 class VTK_INFOVIS_EXPORT vtkExtractHistogram2D : public vtkBivariateStatisticsAlgorithm
00057 {
00058 public:
00059   static vtkExtractHistogram2D* New();
00060   vtkTypeMacro(vtkExtractHistogram2D, vtkBivariateStatisticsAlgorithm);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00063 
00064   enum OutputIndices
00065   {
00066     HISTOGRAM_IMAGE=3
00067   };
00068 
00069 
00071 
00072   vtkSetVector2Macro(NumberOfBins,int);
00073   vtkGetVector2Macro(NumberOfBins,int);
00075 
00077 
00079   vtkSetVector2Macro(ComponentsToProcess,int);
00080   vtkGetVector2Macro(ComponentsToProcess,int);
00082 
00084 
00087   vtkSetVector4Macro(CustomHistogramExtents,double);
00088   vtkGetVector4Macro(CustomHistogramExtents,double);
00090 
00092 
00094   vtkSetMacro(UseCustomHistogramExtents,int);
00095   vtkGetMacro(UseCustomHistogramExtents,int);
00096   vtkBooleanMacro(UseCustomHistogramExtents,int);
00098 
00100 
00103   vtkSetMacro(ScalarType,int);
00104   void SetScalarTypeToUnsignedInt()
00105     {this->SetScalarType(VTK_UNSIGNED_INT);};
00106   void SetScalarTypeToUnsignedLong()
00107     {this->SetScalarType(VTK_UNSIGNED_LONG);};
00108   void SetScalarTypeToUnsignedShort()
00109     {this->SetScalarType(VTK_UNSIGNED_SHORT);};
00110   void SetScalarTypeToUnsignedChar()
00111     {this->SetScalarType(VTK_UNSIGNED_CHAR);};
00112   void SetScalarTypeToFloat()
00113     {this->SetScalarType(VTK_FLOAT);};
00114   void SetScalarTypeToDouble()
00115     {this->SetScalarType(VTK_DOUBLE);};
00116   vtkGetMacro(ScalarType,int);
00118   
00120 
00122   vtkGetMacro(MaximumBinCount,double);
00124 
00127   int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
00128 
00131   int GetBinRange(vtkIdType bin, double range[4]);
00132 
00135   void GetBinWidth(double bw[2]);
00136 
00139   vtkImageData* GetOutputHistogramImage();
00140 
00143   double* GetHistogramExtents();
00144 
00145   vtkSetMacro(SwapColumns,int);
00146   vtkGetMacro(SwapColumns,int);
00147   vtkBooleanMacro(SwapColumns,int);
00148 
00150 
00151   virtual void SetRowMask(vtkDataArray*);
00152   vtkGetObjectMacro(RowMask,vtkDataArray);
00154 
00156   virtual void Aggregate( vtkDataObjectCollection*, vtkMultiBlockDataSet* ) {};
00157 
00158 protected:
00159   vtkExtractHistogram2D();
00160   ~vtkExtractHistogram2D();
00161 
00162   int SwapColumns;
00163   int NumberOfBins[2];
00164   double HistogramExtents[4];
00165   double CustomHistogramExtents[4];
00166   int UseCustomHistogramExtents;
00167   int ComponentsToProcess[2];
00168   double MaximumBinCount;
00169   int ScalarType;
00170   vtkDataArray* RowMask;
00171 
00172   virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
00173 
00175 
00177   virtual void Learn( vtkTable* inData,
00178                       vtkTable* inParameters,
00179                       vtkMultiBlockDataSet* inMeta );
00181 
00183   virtual void Derive( vtkMultiBlockDataSet* ) {};
00184 
00186 
00187   virtual void Test( vtkTable*,
00188                      vtkMultiBlockDataSet*,
00189                      vtkTable* ) { return; }; 
00191 
00193 
00194   virtual void SelectAssessFunctor( vtkTable* vtkNotUsed(outData), 
00195                                     vtkDataObject* vtkNotUsed(inMeta),
00196                                     vtkStringArray* vtkNotUsed(rowNames),
00197                                     AssessFunctor*& vtkNotUsed(dfunc) ) {};
00199 
00200   virtual int FillOutputPortInformation( int port, vtkInformation* info );
00201 
00203 
00205   virtual int RequestInformation (vtkInformation *request, 
00206                                   vtkInformationVector **inputVector, 
00207                                   vtkInformationVector *outputVector);
00209 
00211 
00212   int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
00213 private:
00214   vtkExtractHistogram2D(const vtkExtractHistogram2D&); 
00215   void operator=(const vtkExtractHistogram2D&);   
00216 };
00218 
00219 #endif