VTK  9.0.20201130
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  -------------------------------------------------------------------------*/
53 #ifndef vtkPCAStatistics_h
54 #define vtkPCAStatistics_h
55 
56 #include "vtkFiltersStatisticsModule.h" // For export macro
58 
59 class vtkDoubleArray;
60 class vtkIdTypeArray;
61 
62 class VTKFILTERSSTATISTICS_EXPORT vtkPCAStatistics : public vtkMultiCorrelativeStatistics
63 {
64 public:
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67  static vtkPCAStatistics* New();
68 
73  {
74  NONE,
78  NUM_NORMALIZATION_SCHEMES
79  };
80 
85  {
89  NUM_BASIS_SCHEMES
90  };
91 
93 
115  vtkSetMacro(NormalizationScheme, int);
116  vtkGetMacro(NormalizationScheme, int);
117  virtual void SetNormalizationSchemeByName(const char* schemeName);
118  virtual const char* GetNormalizationSchemeName(int scheme);
120 
122 
146  virtual vtkTable* GetSpecifiedNormalization();
147  virtual void SetSpecifiedNormalization(vtkTable*);
149 
151 
159  void GetEigenvalues(int request, vtkDoubleArray*);
160  void GetEigenvalues(vtkDoubleArray*);
161  double GetEigenvalue(int request, int i);
162  double GetEigenvalue(int i);
164 
166 
176  void GetEigenvectors(int request, vtkDoubleArray* eigenvectors);
177  void GetEigenvectors(vtkDoubleArray* eigenvectors);
178  void GetEigenvector(int i, vtkDoubleArray* eigenvector);
179  void GetEigenvector(int request, int i, vtkDoubleArray* eigenvector);
181 
183 
210  vtkSetMacro(BasisScheme, int);
211  vtkGetMacro(BasisScheme, int);
212  virtual const char* GetBasisSchemeName(int schemeIndex);
213  virtual void SetBasisSchemeByName(const char* schemeName);
215 
217 
222  vtkSetMacro(FixedBasisSize, int);
223  vtkGetMacro(FixedBasisSize, int);
225 
227 
232  vtkSetClampMacro(FixedBasisEnergy, double, 0., 1.);
233  vtkGetMacro(FixedBasisEnergy, double);
235 
241  bool SetParameter(const char* parameter, int index, vtkVariant value) override;
242 
243 protected:
245  ~vtkPCAStatistics() override;
246 
252  int FillInputPortInformation(int port, vtkInformation* info) override;
253 
257  void Derive(vtkMultiBlockDataSet*) override;
258 
262  void Test(vtkTable*, vtkMultiBlockDataSet*, vtkTable*) override;
263 
267  void Assess(vtkTable*, vtkMultiBlockDataSet*, vtkTable*) override;
268 
273  virtual vtkDoubleArray* CalculatePValues(vtkIdTypeArray*, vtkDoubleArray*);
274 
278  void SelectAssessFunctor(vtkTable* inData, vtkDataObject* inMeta, vtkStringArray* rowNames,
279  AssessFunctor*& dfunc) override;
280 
285 
286  static const char* BasisSchemeEnumNames[NUM_BASIS_SCHEMES + 1];
287  static const char* NormalizationSchemeEnumNames[NUM_NORMALIZATION_SCHEMES + 1];
288 
289 private:
290  vtkPCAStatistics(const vtkPCAStatistics&) = delete;
291  void operator=(const vtkPCAStatistics&) = delete;
292 };
293 
294 #endif // vtkPCAStatistics_h
vtkMultiCorrelativeStatistics::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPCAStatistics
A class for multivariate principal component analysis.
Definition: vtkPCAStatistics.h:62
vtkX3D::value
Definition: vtkX3D.h:226
vtkPCAStatistics::ProjectionType
ProjectionType
These are the enumeration values that SetBasisScheme() accepts and GetBasisScheme returns.
Definition: vtkPCAStatistics.h:84
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkPCAStatistics::BasisScheme
int BasisScheme
Definition: vtkPCAStatistics.h:282
vtkPCAStatistics::FixedBasisEnergy
double FixedBasisEnergy
Definition: vtkPCAStatistics.h:284
vtkPCAStatistics::DIAGONAL_VARIANCE
Normalize cov(i,j) by sqrt(cov(i,i)*cov(j,j)).
Definition: vtkPCAStatistics.h:77
vtkPCAStatistics::NormalizationScheme
int NormalizationScheme
Definition: vtkPCAStatistics.h:281
vtkPCAStatistics::NONE
The covariance matrix should be used as computed.
Definition: vtkPCAStatistics.h:74
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:45
vtkMultiCorrelativeStatistics
A class for multivariate linear correlation.
Definition: vtkMultiCorrelativeStatistics.h:89
vtkMultiCorrelativeStatistics::Derive
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
vtkX3D::port
Definition: vtkX3D.h:453
vtkPCAStatistics::FixedBasisSize
int FixedBasisSize
Definition: vtkPCAStatistics.h:283
vtkPCAStatistics::DIAGONAL_SPECIFIED
Normalize cov(i,j) by sqrt(V(i)*V(j)) where V is supplied by the user.
Definition: vtkPCAStatistics.h:76
vtkMultiCorrelativeStatistics::SelectAssessFunctor
void SelectAssessFunctor(vtkTable *inData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:65
vtkMultiCorrelativeStatistics.h
vtkPCAStatistics::NormalizationType
NormalizationType
Methods by which the covariance matrix may be normalized.
Definition: vtkPCAStatistics.h:72
vtkPCAStatistics::FIXED_BASIS_ENERGY
Use consecutive basis matrix entries whose energies sum to at least T.
Definition: vtkPCAStatistics.h:88
vtkPCAStatistics::TRIANGLE_SPECIFIED
Normalize cov(i,j) by V(i,j) where V is supplied by the user.
Definition: vtkPCAStatistics.h:75
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkMultiCorrelativeStatistics::New
static vtkMultiCorrelativeStatistics * New()
vtkStatisticsAlgorithm::SetParameter
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...
vtkX3D::info
Definition: vtkX3D.h:382
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkMultiCorrelativeStatistics::Test
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
Definition: vtkMultiCorrelativeStatistics.h:134
vtkPCAStatistics::FIXED_BASIS_SIZE
Use the first N entries in the basis matrix.
Definition: vtkPCAStatistics.h:87
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkStatisticsAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkX3D::parameter
Definition: vtkX3D.h:449
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkX3D::index
Definition: vtkX3D.h:252
vtkMultiCorrelativeStatistics::Assess
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
vtkPCAStatistics::FULL_BASIS
Use all entries in the basis matrix.
Definition: vtkPCAStatistics.h:86