Statismo  0.10.1
 All Classes Namespaces Functions Typedefs
PCAModelBuilder.h
1 /*
2  * This file is part of the statismo library.
3  *
4  * Author: Marcel Luethi (marcel.luethi@unibas.ch)
5  *
6  * Copyright (c) 2011 University of Basel
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in the
18  * documentation and/or other materials provided with the distribution.
19  *
20  * Neither the name of the project's author nor the names of its
21  * contributors may be used to endorse or promote products derived from
22  * this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
30  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 #ifndef __PCAMODELBUILDER_H_
39 #define __PCAMODELBUILDER_H_
40 
41 #include <memory>
42 #include <vector>
43 
44 #include "CommonTypes.h"
45 #include "Config.h"
46 #include "DataManager.h"
47 #include "ModelBuilder.h"
48 #include "ModelInfo.h"
49 #include "StatisticalModel.h"
50 
51 namespace statismo {
52 
53 
59 template <typename T>
60 class PCAModelBuilder : public ModelBuilder<T> {
61 
62 
63  public:
64 
68  typedef typename DataManagerType::DataItemListType DataItemListType;
69 
73  static PCAModelBuilder* Create() {
74  return new PCAModelBuilder();
75  }
76 
82  void Delete() {
83  delete this;
84  }
85 
86 
90  virtual ~PCAModelBuilder() {}
91 
103  StatisticalModelType* BuildNewModel(const DataItemListType& samples, double noiseVariance, bool computeScores = true) const;
104 
105 
106  private:
107  // to prevent use
108  PCAModelBuilder();
109  PCAModelBuilder(const PCAModelBuilder& orig);
110  PCAModelBuilder& operator=(const PCAModelBuilder& rhs);
111 
112  StatisticalModelType* BuildNewModelInternal(const Representer<T>* representer, const MatrixType& X, double noiseVariance) const;
113 
114 
115 };
116 
117 } // namespace statismo
118 
119 #include "PCAModelBuilder.hxx"
120 
121 #endif /* __PCAMODELBUILDER_H_ */
void Delete()
Definition: PCAModelBuilder.h:82
Common base class for all the model builder classes.
Definition: ModelBuilder.h:54
Manages Training and Test Data for building Statistical Models and provides functionality for Crossva...
Definition: DataManager.h:114
virtual ~PCAModelBuilder()
Definition: PCAModelBuilder.h:90
static PCAModelBuilder * Create()
Definition: PCAModelBuilder.h:73
StatisticalModelType * BuildNewModel(const DataItemListType &samples, double noiseVariance, bool computeScores=true) const
Definition: PCAModelBuilder.hxx:60
Creates StatisticalModel using Principal Component Analysis.
Definition: PCAModelBuilder.h:60
A Point/Value pair that is used to specify a value at a given point.
Definition: StatisticalModel.h:100
ITK Wrapper for the statismo::StatisticalModel class.
Definition: itkStatisticalModel.h:62