VTK  9.1.0
vtkPCAStatistics.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkPCAStatistics.h
5
6Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7All rights reserved.
8See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10This software is distributed WITHOUT ANY WARRANTY; without even
11the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12PURPOSE. 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
88class vtkDoubleArray;
89class vtkIdTypeArray;
90
91class VTKFILTERSSTATISTICS_EXPORT vtkPCAStatistics : public vtkMultiCorrelativeStatistics
92{
93public:
95 void PrintSelf(ostream& os, vtkIndent indent) override;
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
272protected:
275
282
287
292
297
303
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
318private:
319 vtkPCAStatistics(const vtkPCAStatistics&) = delete;
320 void operator=(const vtkPCAStatistics&) = delete;
321};
322
323#endif // vtkPCAStatistics_h
general representation of visualization data
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:113
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.
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 void SetBasisSchemeByName(const char *schemeName)
This variable controls the dimensionality of output tuples in Assess operation.
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
virtual const char * GetNormalizationSchemeName(int scheme)
This determines how (or if) the covariance matrix cov is normalized before PCA.
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)
Get the eigenvalues.
virtual void SetNormalizationSchemeByName(const char *schemeName)
This determines how (or if) the covariance matrix cov is normalized before PCA.
void GetEigenvectors(vtkDoubleArray *eigenvectors)
Get the eigenvectors.
static vtkPCAStatistics * New()
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)
Get the eigenvalues.
virtual void SetSpecifiedNormalization(vtkTable *)
These methods allow you to set/get values used to normalize the covariance matrix before PCA.
void GetEigenvectors(int request, vtkDoubleArray *eigenvectors)
Get the eigenvectors.
void GetEigenvector(int request, int i, vtkDoubleArray *eigenvector)
Get the eigenvectors.
void GetEigenvalues(vtkDoubleArray *)
Get the eigenvalues.
int FillInputPortInformation(int port, vtkInformation *info) override
This algorithm accepts a vtkTable containing normalization values for its fourth input (port 3).
~vtkPCAStatistics() override
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SelectAssessFunctor(vtkTable *inData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
virtual const char * GetBasisSchemeName(int schemeIndex)
This variable controls the dimensionality of output tuples in Assess operation.
virtual vtkDoubleArray * CalculatePValues(vtkIdTypeArray *, vtkDoubleArray *)
Calculate p-value.
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
virtual vtkTable * GetSpecifiedNormalization()
These methods allow you to set/get values used to normalize the covariance matrix before PCA.
void GetEigenvector(int i, vtkDoubleArray *eigenvector)
Get the eigenvectors.
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:172
A atomic type representing the union of many types.
Definition: vtkVariant.h:145
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ parameter
Definition: vtkX3D.h:449
@ index
Definition: vtkX3D.h:252