aimsalgo  5.1.2
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>
16 #include <aims/resampling/motion.h>
17 #include <vector>
18 
19 
20 namespace aims
21 {
22 
24  {
25  public:
26  TransformLeastSquareEstimation( const std::vector<Point3df>& from,
27  const std::vector<Point3df>& to ) ;
28 
30 
32  {
33  if (!_motionCalculated)
34  {
35  computeMotion() ;
36  _motionCalculated = true ;
37  }
38 
39  return _motion;
40  }
41 
42  protected:
43  std::vector<Point3df> _pointsFrom ;
44  std::vector<Point3df> _pointsTo ;
45 
48  bool _is2D ;
49 
50  virtual bool computeMotion() = 0;
51  } ;
52 
53 
54 
56  {
57  public:
58  AffineLeastSquareEstimation( const std::vector<Point3df>& from,
59  const std::vector<Point3df>& to ) ;
60 
62 
63 
64  protected:
65  virtual bool computeMotion() ;
66  } ;
67 
68 
69 
71  {
72  public:
73  RigidLeastSquareEstimation( const std::vector<Point3df>& from,
74  const std::vector<Point3df>& to ) ;
75 
77 
79  const Point3df& p1, const Point3df& p2,
80  const Point3df& gc1, const Point3df& gc2, float weight ) ;
81  double error() ;
82 
83 
84  protected:
85  virtual bool computeMotion() {return computeRigidMotion();}
86  virtual bool computeRigidMotion() ;
89  } ;
90 
92  {
93  public:
94  TranslationLeastSquareEstimation( const std::vector<Point3df>& from,
95  const std::vector<Point3df>& to ) ;
96 
98 
100  const Point3df& p1, const Point3df& p2,
101  const Point3df& gc1, const Point3df& gc2, float weight ) ;
102  double error() ;
103 
104 
105  protected:
106  virtual bool computeMotion() {return computeTranslationMotion();}
107  virtual bool computeTranslationMotion() ;
108 
111  } ;
112 
113 
114 
116  {
117  public:
118  SimiLeastSquareEstimation( const std::vector<Point3df>& from,
119  const std::vector<Point3df>& to ) ;
120 
122 
123 
124  protected:
125  virtual bool computeMotion() ;
126 
127  } ;
128 
129 
130 }
131 
132 
133 #endif
AffineLeastSquareEstimation(const std::vector< Point3df > &from, const std::vector< Point3df > &to)
static carto::VolumeRef< float > criterionItem(const Point3df &p1, const Point3df &p2, const Point3df &gc1, const Point3df &gc2, float weight)
RigidLeastSquareEstimation(const std::vector< Point3df > &from, const std::vector< Point3df > &to)
SimiLeastSquareEstimation(const std::vector< Point3df > &from, const std::vector< Point3df > &to)
TransformLeastSquareEstimation(const std::vector< Point3df > &from, const std::vector< Point3df > &to)
static carto::VolumeRef< float > criterionItem(const Point3df &p1, const Point3df &p2, const Point3df &gc1, const Point3df &gc2, float weight)
TranslationLeastSquareEstimation(const std::vector< Point3df > &from, const std::vector< Point3df > &to)