VTK
dox/Hybrid/vtkPCAAnalysisFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPCAAnalysisFilter.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 =========================================================================*/
00053 #ifndef __vtkPCAAnalysisFilter_h
00054 #define __vtkPCAAnalysisFilter_h
00055 
00056 #include "vtkPointSetAlgorithm.h"
00057 
00058 class vtkFloatArray;
00059 class vtkPointSet;
00060 
00061 class VTK_HYBRID_EXPORT vtkPCAAnalysisFilter : public vtkPointSetAlgorithm
00062 {
00063  public:
00064   vtkTypeMacro(vtkPCAAnalysisFilter,vtkPointSetAlgorithm);
00065   
00067   void PrintSelf(ostream& os, vtkIndent indent);
00068   
00070   static vtkPCAAnalysisFilter *New();
00071 
00073 
00074   vtkGetObjectMacro(Evals, vtkFloatArray);
00076   
00078   void SetNumberOfInputs(int n);
00079 
00081 
00083   void SetInput(int idx, vtkPointSet* p);
00084   void SetInput(int idx, vtkDataObject* input);
00086 
00089   vtkPointSet* GetInput(int idx);
00090 
00097   void GetParameterisedShape(vtkFloatArray *b, vtkPointSet* shape);
00098 
00104   void GetShapeParameters(vtkPointSet *shape, vtkFloatArray *b, int bsize);
00105 
00108   int GetModesRequiredFor(double proportion);
00109 
00110 protected:
00111   vtkPCAAnalysisFilter();
00112   ~vtkPCAAnalysisFilter();
00113 
00115 
00116   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00117   virtual int FillInputPortInformation(int port, vtkInformation *info);
00119 
00120 private:
00121   vtkPCAAnalysisFilter(const vtkPCAAnalysisFilter&);  // Not implemented.
00122   void operator=(const vtkPCAAnalysisFilter&);  // Not implemented.
00123 
00124   // Eigenvalues
00125   vtkFloatArray *Evals;
00126 
00127   // Matrix where each column is an eigenvector
00128   double **evecMat2;
00129 
00130   // The mean shape in a vector
00131   double *meanshape;
00132 };
00133 
00134 #endif
00135 
00136