VTK  9.3.0
vtkPCAStatistics.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2010 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
49 #ifndef vtkPCAStatistics_h
50 #define vtkPCAStatistics_h
51 
52 #include "vtkFiltersStatisticsModule.h" // For export macro
54 
55 VTK_ABI_NAMESPACE_BEGIN
56 class vtkDoubleArray;
57 class vtkIdTypeArray;
58 
59 class VTKFILTERSSTATISTICS_EXPORT vtkPCAStatistics : public vtkMultiCorrelativeStatistics
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64  static vtkPCAStatistics* New();
65 
70  {
71  NONE,
75  NUM_NORMALIZATION_SCHEMES
76  };
77 
82  {
86  NUM_BASIS_SCHEMES
87  };
88 
90 
112  vtkSetMacro(NormalizationScheme, int);
113  vtkGetMacro(NormalizationScheme, int);
114  virtual void SetNormalizationSchemeByName(const char* schemeName);
115  virtual const char* GetNormalizationSchemeName(int scheme);
117 
119 
146 
148 
156  void GetEigenvalues(int request, vtkDoubleArray*);
158  double GetEigenvalue(int request, int i);
159  double GetEigenvalue(int i);
161 
163 
173  void GetEigenvectors(int request, vtkDoubleArray* eigenvectors);
174  void GetEigenvectors(vtkDoubleArray* eigenvectors);
175  void GetEigenvector(int i, vtkDoubleArray* eigenvector);
176  void GetEigenvector(int request, int i, vtkDoubleArray* eigenvector);
178 
180 
207  vtkSetMacro(BasisScheme, int);
208  vtkGetMacro(BasisScheme, int);
209  virtual const char* GetBasisSchemeName(int schemeIndex);
210  virtual void SetBasisSchemeByName(const char* schemeName);
212 
214 
219  vtkSetMacro(FixedBasisSize, int);
220  vtkGetMacro(FixedBasisSize, int);
222 
224 
229  vtkSetClampMacro(FixedBasisEnergy, double, 0., 1.);
230  vtkGetMacro(FixedBasisEnergy, double);
232 
238  bool SetParameter(const char* parameter, int index, vtkVariant value) override;
239 
240 protected:
242  ~vtkPCAStatistics() override;
243 
250 
254  void Derive(vtkMultiBlockDataSet*) override;
255 
260 
265 
271 
275  void SelectAssessFunctor(vtkTable* inData, vtkDataObject* inMeta, vtkStringArray* rowNames,
276  AssessFunctor*& dfunc) override;
277 
282 
283  static const char* BasisSchemeEnumNames[NUM_BASIS_SCHEMES + 1];
284  static const char* NormalizationSchemeEnumNames[NUM_NORMALIZATION_SCHEMES + 1];
285 
286 private:
287  vtkPCAStatistics(const vtkPCAStatistics&) = delete;
288  void operator=(const vtkPCAStatistics&) = delete;
289 };
290 
291 VTK_ABI_NAMESPACE_END
292 #endif // vtkPCAStatistics_h
general representation of visualization data
Definition: vtkDataObject.h:64
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:38
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)
This determines how (or if) the covariance matrix cov is normalized before PCA.
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.
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.
virtual vtkDoubleArray * CalculatePValues(vtkIdTypeArray *, vtkDoubleArray *)
Calculate p-value.
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.
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
static vtkPCAStatistics * New()
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.
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
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:68
A type representing the union of many types.
Definition: vtkVariant.h:62
@ 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