aimsalgo  5.0.5
Neuroimaging image processing
least_square_estimation.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2013 CEA
2  *
3  * This software and supporting documentation were developed by
4  * bioPICSEL
5  * CEA/DSV/I²BM/MIRCen/LMN, Batiment 61,
6  * 18, route du Panorama
7  * 92265 Fontenay-aux-Roses
8  * France
9  */
10 
11 #ifndef AIMS_TRANSFORM_LEAST_SQUARE_SESTIMATION_H
12 #define AIMS_TRANSFORM_LEAST_SQUARE_SESTIMATION_H
13 
14 #include <aims/vector/vector.h>
15 #include <aims/data/data.h>
16 #include <aims/resampling/motion.h>
17 #include <vector>
18 
19 
20 namespace aims {
21 
23  public:
24  TransformLeastSquareEstimation( const std::vector<Point3df>& from,
25  const std::vector<Point3df>& to ) ;
26 
28 
30  {
31  if (!_motionCalculated){
32  computeMotion() ;
33  _motionCalculated = true ;
34  }
35 
36  return _motion;
37  }
38 
39  protected:
40  std::vector<Point3df> _pointsFrom ;
41  std::vector<Point3df> _pointsTo ;
42 
45  bool _is2D ;
46 
47  virtual bool computeMotion() = 0;
48  } ;
49 
50 
51 
53  public:
54  AffineLeastSquareEstimation( const std::vector<Point3df>& from,
55  const std::vector<Point3df>& to ) ;
56 
58 
59 
60  protected:
61  virtual bool computeMotion() ;
62  } ;
63 
64 
65 
67  public:
68  RigidLeastSquareEstimation( const std::vector<Point3df>& from,
69  const std::vector<Point3df>& to ) ;
70 
72 
73  static AimsData<float> criterionItem( const Point3df& p1, const Point3df& p2,
74  const Point3df& gc1, const Point3df& gc2, float weight ) ;
75  double error() ;
76 
77 
78  protected:
79  virtual bool computeMotion() {return computeRigidMotion();}
80  virtual bool computeRigidMotion() ;
83  } ;
84 
86  public:
87  TranslationLeastSquareEstimation( const std::vector<Point3df>& from,
88  const std::vector<Point3df>& to ) ;
89 
91 
92  static AimsData<float> criterionItem( const Point3df& p1, const Point3df& p2,
93  const Point3df& gc1, const Point3df& gc2, float weight ) ;
94  double error() ;
95 
96 
97  protected:
98  virtual bool computeMotion() {return computeTranslationMotion();}
99  virtual bool computeTranslationMotion() ;
100 
103  } ;
104 
105 
106 
108  public:
109  SimiLeastSquareEstimation( const std::vector<Point3df>& from,
110  const std::vector<Point3df>& to ) ;
111 
113 
114 
115  protected:
116  virtual bool computeMotion() ;
117 
118  } ;
119 
120 
121 }
122 
123 
124 #endif
TransformLeastSquareEstimation(const std::vector< Point3df > &from, const std::vector< Point3df > &to)