00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkPCAAnalysisFilter.h,v $ 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 "vtkSource.h" 00057 00058 class vtkFloatArray; 00059 class vtkPointSet; 00060 00061 class VTK_HYBRID_EXPORT vtkPCAAnalysisFilter : public vtkSource 00062 { 00063 public: 00064 vtkTypeRevisionMacro(vtkPCAAnalysisFilter,vtkSource); 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 00082 void SetInput(int idx,vtkPointSet* p); 00083 00086 vtkPointSet* GetOutput(int idx); 00087 00094 void GetParameterisedShape(vtkFloatArray *b, vtkPointSet* shape); 00095 00101 void GetShapeParameters(vtkPointSet *shape, vtkFloatArray *b, int bsize); 00102 00105 vtkPointSet* GetInput(int idx); 00106 00109 int GetModesRequiredFor(double proportion); 00110 00111 protected: 00112 vtkPCAAnalysisFilter(); 00113 ~vtkPCAAnalysisFilter(); 00114 00116 void Execute(); 00117 00118 private: 00119 vtkPCAAnalysisFilter(const vtkPCAAnalysisFilter&); // Not implemented. 00120 void operator=(const vtkPCAAnalysisFilter&); // Not implemented. 00121 00122 // Eigenvalues 00123 vtkFloatArray *Evals; 00124 00125 // Matrix where each column is an eigenvector 00126 double **evecMat2; 00127 00128 // The mean shape in a vector 00129 double *meanshape; 00130 }; 00131 00132 #endif 00133 00134