VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Filters/Imaging/vtkExtractHistogram2D.h
Go to the documentation of this file.
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 2011 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 "vtkFiltersImagingModule.h" // For export macro
00051 #include "vtkStatisticsAlgorithm.h"
00052 
00053 class vtkImageData;
00054 class vtkIdTypeArray;
00055 class vtkMultiBlockDataSet;
00056 
00057 class VTKFILTERSIMAGING_EXPORT vtkExtractHistogram2D : public vtkStatisticsAlgorithm
00058 {
00059 public:
00060   static vtkExtractHistogram2D* New();
00061   vtkTypeMacro(vtkExtractHistogram2D, vtkStatisticsAlgorithm);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00064 //BTX
00065   enum OutputIndices
00066   {
00067     HISTOGRAM_IMAGE=3
00068   };
00069 //ETX
00070 
00072 
00073   vtkSetVector2Macro(NumberOfBins,int);
00074   vtkGetVector2Macro(NumberOfBins,int);
00076 
00078 
00080   vtkSetVector2Macro(ComponentsToProcess,int);
00081   vtkGetVector2Macro(ComponentsToProcess,int);
00083 
00085 
00088   vtkSetVector4Macro(CustomHistogramExtents,double);
00089   vtkGetVector4Macro(CustomHistogramExtents,double);
00091 
00093 
00095   vtkSetMacro(UseCustomHistogramExtents,int);
00096   vtkGetMacro(UseCustomHistogramExtents,int);
00097   vtkBooleanMacro(UseCustomHistogramExtents,int);
00099 
00101 
00104   vtkSetMacro(ScalarType,int);
00105   void SetScalarTypeToUnsignedInt()
00106     {this->SetScalarType(VTK_UNSIGNED_INT);};
00107   void SetScalarTypeToUnsignedLong()
00108     {this->SetScalarType(VTK_UNSIGNED_LONG);};
00109   void SetScalarTypeToUnsignedShort()
00110     {this->SetScalarType(VTK_UNSIGNED_SHORT);};
00111   void SetScalarTypeToUnsignedChar()
00112     {this->SetScalarType(VTK_UNSIGNED_CHAR);};
00113   void SetScalarTypeToFloat()
00114     {this->SetScalarType(VTK_FLOAT);};
00115   void SetScalarTypeToDouble()
00116     {this->SetScalarType(VTK_DOUBLE);};
00117   vtkGetMacro(ScalarType,int);
00119 
00121 
00123   vtkGetMacro(MaximumBinCount,double);
00125 
00128   int GetBinRange(vtkIdType binX, vtkIdType binY, double range[4]);
00129 
00132   int GetBinRange(vtkIdType bin, double range[4]);
00133 
00136   void GetBinWidth(double bw[2]);
00137 
00140   vtkImageData* GetOutputHistogramImage();
00141 
00144   double* GetHistogramExtents();
00145 
00146   vtkSetMacro(SwapColumns,int);
00147   vtkGetMacro(SwapColumns,int);
00148   vtkBooleanMacro(SwapColumns,int);
00149 
00151 
00152   virtual void SetRowMask(vtkDataArray*);
00153   vtkGetObjectMacro(RowMask,vtkDataArray);
00155 
00157   virtual void Aggregate( vtkDataObjectCollection*, vtkMultiBlockDataSet* ) {}
00158 
00159 protected:
00160   vtkExtractHistogram2D();
00161   ~vtkExtractHistogram2D();
00162 
00163   int SwapColumns;
00164   int NumberOfBins[2];
00165   double HistogramExtents[4];
00166   double CustomHistogramExtents[4];
00167   int UseCustomHistogramExtents;
00168   int ComponentsToProcess[2];
00169   double MaximumBinCount;
00170   int ScalarType;
00171   vtkDataArray* RowMask;
00172 
00173   virtual int ComputeBinExtents(vtkDataArray* col1, vtkDataArray* col2);
00174 
00176 
00178   virtual void Learn( vtkTable* inData,
00179                       vtkTable* inParameters,
00180                       vtkMultiBlockDataSet* inMeta );
00182 
00184   virtual void Derive( vtkMultiBlockDataSet* ) {}
00185 
00187 
00188   virtual void Test( vtkTable*,
00189                      vtkMultiBlockDataSet*,
00190                      vtkTable* ) { return; };
00192 
00194 
00195   virtual void Assess( vtkTable*,
00196                        vtkMultiBlockDataSet*,
00197                        vtkTable* ) { return; };
00199 
00201 
00202   virtual void SelectAssessFunctor( vtkTable* vtkNotUsed(outData),
00203                                     vtkDataObject* vtkNotUsed(inMeta),
00204                                     vtkStringArray* vtkNotUsed(rowNames),
00205                                     AssessFunctor*& vtkNotUsed(dfunc) ) {}
00207 
00208   virtual int FillOutputPortInformation( int port, vtkInformation* info );
00209 
00211 
00213   virtual int RequestInformation (vtkInformation *request,
00214                                   vtkInformationVector **inputVector,
00215                                   vtkInformationVector *outputVector);
00217 
00219 
00220   int GetInputArrays(vtkDataArray*& col1, vtkDataArray*& col2);
00221 private:
00222   vtkExtractHistogram2D(const vtkExtractHistogram2D&); // Not implemented
00223   void operator=(const vtkExtractHistogram2D&);   // Not implemented
00224 };
00226 
00227 #endif