VTK  9.0.20210926
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  -------------------------------------------------------------------------*/
82 #ifndef vtkPCAStatistics_h
83 #define vtkPCAStatistics_h
84 
85 #include "vtkFiltersStatisticsModule.h" // For export macro
87 
88 class vtkDoubleArray;
89 class vtkIdTypeArray;
90 
91 class VTKFILTERSSTATISTICS_EXPORT vtkPCAStatistics : public vtkMultiCorrelativeStatistics
92 {
93 public:
95  void PrintSelf(ostream& os, vtkIndent indent) override;
96  static vtkPCAStatistics* New();
97 
102  {
107  NUM_NORMALIZATION_SCHEMES
108  };
109 
114  {
118  NUM_BASIS_SCHEMES
119  };
120 
122 
144  vtkSetMacro(NormalizationScheme, int);
145  vtkGetMacro(NormalizationScheme, int);
146  virtual void SetNormalizationSchemeByName(const char* schemeName);
147  virtual const char* GetNormalizationSchemeName(int scheme);
149 
151 
178 
180 
188  void GetEigenvalues(int request, vtkDoubleArray*);
190  double GetEigenvalue(int request, int i);
191  double GetEigenvalue(int i);
193 
195 
205  void GetEigenvectors(int request, vtkDoubleArray* eigenvectors);
206  void GetEigenvectors(vtkDoubleArray* eigenvectors);
207  void GetEigenvector(int i, vtkDoubleArray* eigenvector);
208  void GetEigenvector(int request, int i, vtkDoubleArray* eigenvector);
210 
212 
239  vtkSetMacro(BasisScheme, int);
240  vtkGetMacro(BasisScheme, int);
241  virtual const char* GetBasisSchemeName(int schemeIndex);
242  virtual void SetBasisSchemeByName(const char* schemeName);
244 
246 
251  vtkSetMacro(FixedBasisSize, int);
252  vtkGetMacro(FixedBasisSize, int);
254 
256 
261  vtkSetClampMacro(FixedBasisEnergy, double, 0., 1.);
262  vtkGetMacro(FixedBasisEnergy, double);
264 
270  bool SetParameter(const char* parameter, int index, vtkVariant value) override;
271 
272 protected:
274  ~vtkPCAStatistics() override;
275 
282 
286  void Derive(vtkMultiBlockDataSet*) override;
287 
292 
297 
303 
307  void SelectAssessFunctor(vtkTable* inData, vtkDataObject* inMeta, vtkStringArray* rowNames,
308  AssessFunctor*& dfunc) override;
309 
314 
315  static const char* BasisSchemeEnumNames[NUM_BASIS_SCHEMES + 1];
316  static const char* NormalizationSchemeEnumNames[NUM_NORMALIZATION_SCHEMES + 1];
317 
318 private:
319  vtkPCAStatistics(const vtkPCAStatistics&) = delete;
320  void operator=(const vtkPCAStatistics&) = delete;
321 };
322 
323 #endif // vtkPCAStatistics_h
vtkPCAStatistics::GetSpecifiedNormalization
virtual vtkTable * GetSpecifiedNormalization()
These methods allow you to set/get values used to normalize the covariance matrix before PCA.
vtkPCAStatistics::Assess
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
vtkPCAStatistics
A class for multivariate principal component analysis.
Definition: vtkPCAStatistics.h:92
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkPCAStatistics::ProjectionType
ProjectionType
These are the enumeration values that SetBasisScheme() accepts and GetBasisScheme returns.
Definition: vtkPCAStatistics.h:114
vtkPCAStatistics::Derive
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
vtkPCAStatistics::BasisScheme
int BasisScheme
Definition: vtkPCAStatistics.h:311
vtkPCAStatistics::FixedBasisEnergy
double FixedBasisEnergy
Definition: vtkPCAStatistics.h:313
vtkPCAStatistics::GetEigenvectors
void GetEigenvectors(vtkDoubleArray *eigenvectors)
Get the eigenvectors.
vtkPCAStatistics::DIAGONAL_VARIANCE
@ DIAGONAL_VARIANCE
Normalize cov(i,j) by sqrt(cov(i,i)*cov(j,j)).
Definition: vtkPCAStatistics.h:106
vtkPCAStatistics::NormalizationScheme
int NormalizationScheme
Definition: vtkPCAStatistics.h:310
vtkStatisticsAlgorithm::AssessFunctor
A base class for a functor that assesses data.
Definition: vtkStatisticsAlgorithm.h:205
vtkPCAStatistics::CalculatePValues
virtual vtkDoubleArray * CalculatePValues(vtkIdTypeArray *, vtkDoubleArray *)
Calculate p-value.
vtkPCAStatistics::NONE
@ NONE
The covariance matrix should be used as computed.
Definition: vtkPCAStatistics.h:103
vtkPCAStatistics::GetNormalizationSchemeName
virtual const char * GetNormalizationSchemeName(int scheme)
This determines how (or if) the covariance matrix cov is normalized before PCA.
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:155
vtkMultiCorrelativeStatistics
A class for multivariate linear correlation.
Definition: vtkMultiCorrelativeStatistics.h:90
vtkPCAStatistics::GetEigenvector
void GetEigenvector(int request, int i, vtkDoubleArray *eigenvector)
Get the eigenvectors.
vtkPCAStatistics::GetEigenvalues
void GetEigenvalues(vtkDoubleArray *)
Get the eigenvalues.
vtkPCAStatistics::GetEigenvalue
double GetEigenvalue(int request, int i)
Get the eigenvalues.
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkPCAStatistics::GetEigenvalue
double GetEigenvalue(int i)
Get the eigenvalues.
vtkPCAStatistics::FixedBasisSize
int FixedBasisSize
Definition: vtkPCAStatistics.h:312
vtkPCAStatistics::SetBasisSchemeByName
virtual void SetBasisSchemeByName(const char *schemeName)
This variable controls the dimensionality of output tuples in Assess operation.
vtkPCAStatistics::DIAGONAL_SPECIFIED
@ DIAGONAL_SPECIFIED
Normalize cov(i,j) by sqrt(V(i)*V(j)) where V is supplied by the user.
Definition: vtkPCAStatistics.h:105
vtkPCAStatistics::Test
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
vtkPCAStatistics::vtkPCAStatistics
vtkPCAStatistics()
vtkPCAStatistics::SetNormalizationSchemeByName
virtual void SetNormalizationSchemeByName(const char *schemeName)
This determines how (or if) the covariance matrix cov is normalized before PCA.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:155
vtkPCAStatistics::GetEigenvector
void GetEigenvector(int i, vtkDoubleArray *eigenvector)
Get the eigenvectors.
vtkMultiCorrelativeStatistics.h
vtkPCAStatistics::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPCAStatistics::SetParameter
bool SetParameter(const char *parameter, int index, vtkVariant value) override
A convenience method (in particular for access from other applications) to set parameter values.
vtkPCAStatistics::NormalizationType
NormalizationType
Methods by which the covariance matrix may be normalized.
Definition: vtkPCAStatistics.h:102
vtkPCAStatistics::FIXED_BASIS_ENERGY
@ FIXED_BASIS_ENERGY
Use consecutive basis matrix entries whose energies sum to at least T.
Definition: vtkPCAStatistics.h:117
vtkPCAStatistics::TRIANGLE_SPECIFIED
@ TRIANGLE_SPECIFIED
Normalize cov(i,j) by V(i,j) where V is supplied by the user.
Definition: vtkPCAStatistics.h:104
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkPCAStatistics::GetBasisSchemeName
virtual const char * GetBasisSchemeName(int schemeIndex)
This variable controls the dimensionality of output tuples in Assess operation.
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:145
vtkPCAStatistics::FIXED_BASIS_SIZE
@ FIXED_BASIS_SIZE
Use the first N entries in the basis matrix.
Definition: vtkPCAStatistics.h:116
vtkPCAStatistics::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
This algorithm accepts a vtkTable containing normalization values for its fourth input (port 3).
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:146
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:145
vtkPCAStatistics::SelectAssessFunctor
void SelectAssessFunctor(vtkTable *inData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
vtkPCAStatistics::GetEigenvalues
void GetEigenvalues(int request, vtkDoubleArray *)
Get the eigenvalues.
vtkX3D::parameter
@ parameter
Definition: vtkX3D.h:449
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkPCAStatistics::GetEigenvectors
void GetEigenvectors(int request, vtkDoubleArray *eigenvectors)
Get the eigenvectors.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkPCAStatistics::~vtkPCAStatistics
~vtkPCAStatistics() override
vtkPCAStatistics::New
static vtkPCAStatistics * New()
vtkPCAStatistics::FULL_BASIS
@ FULL_BASIS
Use all entries in the basis matrix.
Definition: vtkPCAStatistics.h:115
vtkPCAStatistics::SetSpecifiedNormalization
virtual void SetSpecifiedNormalization(vtkTable *)
These methods allow you to set/get values used to normalize the covariance matrix before PCA.