VTK
vtkPCAStatistics.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkPCAStatistics.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2010 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19  -------------------------------------------------------------------------*/
56 #ifndef vtkPCAStatistics_h
57 #define vtkPCAStatistics_h
58 
59 #include "vtkFiltersStatisticsModule.h" // For export macro
61 
62 class vtkDoubleArray;
63 class vtkIdTypeArray;
64 
65 class VTKFILTERSSTATISTICS_EXPORT vtkPCAStatistics : public vtkMultiCorrelativeStatistics
66 {
67 public:
69  void PrintSelf( ostream& os, vtkIndent indent ) VTK_OVERRIDE;
70  static vtkPCAStatistics* New();
71 
76  {
77  NONE,
81  NUM_NORMALIZATION_SCHEMES
82  };
83 
88  {
92  NUM_BASIS_SCHEMES
93  };
94 
96 
118  vtkSetMacro(NormalizationScheme,int);
119  vtkGetMacro(NormalizationScheme,int);
120  virtual void SetNormalizationSchemeByName( const char* sname );
121  virtual const char* GetNormalizationSchemeName( int scheme );
123 
125 
152 
154 
162  void GetEigenvalues(int request, vtkDoubleArray*);
164  double GetEigenvalue(int request, int i);
165  double GetEigenvalue(int i);
167 
169 
179  void GetEigenvectors(int request, vtkDoubleArray* eigenvectors);
180  void GetEigenvectors(vtkDoubleArray* eigenvectors);
181  void GetEigenvector(int i, vtkDoubleArray* eigenvector);
182  void GetEigenvector(int request, int i, vtkDoubleArray* eigenvector);
184 
186 
213  vtkSetMacro(BasisScheme,int);
214  vtkGetMacro(BasisScheme,int);
215  virtual const char* GetBasisSchemeName( int schemeIndex );
216  virtual void SetBasisSchemeByName( const char* schemeName );
218 
220 
224  vtkSetMacro(FixedBasisSize,int);
225  vtkGetMacro(FixedBasisSize,int);
227 
229 
233  vtkSetClampMacro(FixedBasisEnergy,double,0.,1.);
234  vtkGetMacro(FixedBasisEnergy,double);
236 
242  bool SetParameter( const char* parameter,
243  int index,
244  vtkVariant value ) VTK_OVERRIDE;
245 
246 protected:
248  ~vtkPCAStatistics() VTK_OVERRIDE;
249 
255  int FillInputPortInformation( int port, vtkInformation* info ) VTK_OVERRIDE;
256 
260  void Derive( vtkMultiBlockDataSet* ) VTK_OVERRIDE;
261 
265  void Test( vtkTable*,
267  vtkTable* ) VTK_OVERRIDE;
268 
272  void Assess( vtkTable*,
274  vtkTable* ) VTK_OVERRIDE;
275 
280  virtual vtkDoubleArray* CalculatePValues(vtkIdTypeArray*, vtkDoubleArray*);
281 
285  void SelectAssessFunctor( vtkTable* inData,
286  vtkDataObject* inMeta,
287  vtkStringArray* rowNames,
288  AssessFunctor*& dfunc ) VTK_OVERRIDE;
289 
290  int NormalizationScheme;
291  int BasisScheme;
292  int FixedBasisSize;
293  double FixedBasisEnergy;
294 
295  static const char* BasisSchemeEnumNames[NUM_BASIS_SCHEMES + 1];
296  static const char* NormalizationSchemeEnumNames[NUM_NORMALIZATION_SCHEMES + 1];
297 
298 private:
299  vtkPCAStatistics( const vtkPCAStatistics& ) VTK_DELETE_FUNCTION;
300  void operator = ( const vtkPCAStatistics& ) VTK_DELETE_FUNCTION;
301 };
302 
303 #endif // vtkPCAStatistics_h
304 
Tests instantiations of the vtkNew class template.
general representation of visualization data
Definition: vtkDataObject.h:65
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
A class for multivariate linear correlation.
A class for multivariate principal component analysis.
virtual vtkTable * GetSpecifiedNormalization()
These methods allow you to set/get values used to normalize the covariance matrix before PCA.
ProjectionType
These are the enumeration values that SetBasisScheme() accepts and GetBasisScheme returns.
@ FIXED_BASIS_SIZE
Use the first N entries in the basis matrix.
@ FULL_BASIS
Use all entries in the basis matrix.
@ FIXED_BASIS_ENERGY
Use consecutive basis matrix entries whose energies sum to at least T.
virtual const char * GetNormalizationSchemeName(int scheme)
virtual void SetBasisSchemeByName(const char *schemeName)
bool SetParameter(const char *parameter, int index, vtkVariant value) override
A convenience method (in particular for access from other applications) to set parameter values.
void GetEigenvalues(int request, vtkDoubleArray *)
Get the eigenvalues.
double GetEigenvalue(int i)
void GetEigenvectors(vtkDoubleArray *eigenvectors)
NormalizationType
Methods by which the covariance matrix may be normalized.
@ TRIANGLE_SPECIFIED
Normalize cov(i,j) by V(i,j) where V is supplied by the user.
@ NONE
The covariance matrix should be used as computed.
@ DIAGONAL_SPECIFIED
Normalize cov(i,j) by sqrt(V(i)*V(j)) where V is supplied by the user.
@ DIAGONAL_VARIANCE
Normalize cov(i,j) by sqrt(cov(i,i)*cov(j,j)).
double GetEigenvalue(int request, int i)
virtual void SetSpecifiedNormalization(vtkTable *)
void GetEigenvectors(int request, vtkDoubleArray *eigenvectors)
Get the eigenvectors.
void GetEigenvector(int request, int i, vtkDoubleArray *eigenvector)
void GetEigenvalues(vtkDoubleArray *)
~vtkPCAStatistics() override
static vtkPCAStatistics * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual const char * GetBasisSchemeName(int schemeIndex)
virtual void SetNormalizationSchemeByName(const char *sname)
void GetEigenvector(int i, vtkDoubleArray *eigenvector)
A base class for a functor that assesses data.
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ parameter
Definition: vtkX3D.h:443
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.