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 ) 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 
149  virtual vtkTable* GetSpecifiedNormalization();
150  virtual void SetSpecifiedNormalization( vtkTable* );
152 
154 
162  void GetEigenvalues(int request, vtkDoubleArray*);
163  void GetEigenvalues(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 ) override;
245 
246 protected:
248  ~vtkPCAStatistics() override;
249 
255  int FillInputPortInformation( int port, vtkInformation* info ) override;
256 
260  void Derive( vtkMultiBlockDataSet* ) override;
261 
265  void Test( vtkTable*,
267  vtkTable* ) override;
268 
272  void Assess( vtkTable*,
274  vtkTable* ) override;
275 
280  virtual vtkDoubleArray* CalculatePValues(vtkIdTypeArray*, vtkDoubleArray*);
281 
285  void SelectAssessFunctor( vtkTable* inData,
286  vtkDataObject* inMeta,
287  vtkStringArray* rowNames,
288  AssessFunctor*& dfunc ) override;
289 
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& ) = delete;
300  void operator = ( const vtkPCAStatistics& ) = delete;
301 };
302 
303 #endif // vtkPCAStatistics_h
304 
A base class for a functor that assesses data.
Normalize cov(i,j) by sqrt(V(i)*V(j)) where V is supplied by the user.
NormalizationType
Methods by which the covariance matrix may be normalized.
Store vtkAlgorithm input/output information.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of vtkIdType
Normalize cov(i,j) by V(i,j) where V is supplied by the user.
A atomic type representing the union of many types.
Definition: vtkVariant.h:71
dynamic, self-adjusting array of double
A class for multivariate linear correlation.
Use the first N entries in the basis matrix.
Use all entries in the basis matrix.
a simple class to control print indentation
Definition: vtkIndent.h:39
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
static vtkMultiCorrelativeStatistics * New()
ProjectionType
These are the enumeration values that SetBasisScheme() accepts and GetBasisScheme returns...
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
void SelectAssessFunctor(vtkTable *inData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
A class for multivariate principal component analysis.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
virtual bool SetParameter(const char *parameter, int index, vtkVariant value)
A convenience method (in particular for access from other applications) to set parameter values of Le...
Normalize cov(i,j) by sqrt(cov(i,i)*cov(j,j)).
Composite dataset that organizes datasets into blocks.
The covariance matrix should be used as computed.
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
general representation of visualization data
Definition: vtkDataObject.h:64
Use consecutive basis matrix entries whose energies sum to at least T.