TrafPars3dAffine.hpp
1 #ifndef OPALS_TRAF_PARS_3D_AFFINE_HPP_INCLUDED
2 #define OPALS_TRAF_PARS_3D_AFFINE_HPP_INCLUDED
3 
4 #include <opals/fwd.hpp>
5 #include <opals/CustomOptionType.hpp>
6 #include <opals/LSMProcMode.hpp>
7 #include <opals/Array.hpp>
8 #include <opals/String.hpp>
9 
10 namespace opals {
11 
12  /// \class TrafPars3dAffine
13  /// Describes a relative or absolute 3D-affine transformation.
14  /** This class contains the transformation parameters of an affine 3D (i.e. 12-parameter) transformation, given as 12-array */
15  /**
16  trafPars (\f$tp\f$), representing the affine transformation matrix A and the translation vector t
17  \f[
18  A = \begin{pmatrix} tp_1 & tp_2 & tp_3 \\
19  tp_5 & tp_6 & tp_7 \\
20  tp_9 & tp_{10} & tp_{11} \end{pmatrix}
21  \f]
22  \f[
23  t = \begin{pmatrix} tp_4 \\
24  tp_8 \\
25  tp_{12} \end{pmatrix}
26  \f]
27  The transformation is defined as follows:
28  \f[
29  y = A(x-x_0) + t + x_0
30  \f]
31  with
32  \f[
33  \begin{matrix}
34  y & \ldots & \text{point in destination ("fix") system} \\
35  x & \ldots & \text{point in source ("mov") system} \\
36  x_0 & \ldots & \text{source system's reference point (reduction point; refPointMov)} \\
37  \end{matrix}
38  \f]
39  The 144-array \f$q_{xx}\f$ contains the \f$Q_{xx}\f$ matrix of trafPars:
40  \f[
41  Q_{xx} =
42  \begin{pmatrix}
43  q_{1 }(a_{1,1},a_{1,1}) & q_{2 }(a_{1,1},a_{1,2}) & q_{3 }(a_{1,1},a_{1,3}) & q_{4 }(a_{1,1},t_1) & q_{5 }(a_{1,1},a_{2,1}) & \ldots & q_{12 }(a_{1,1},t_3) \\
44  q_{13 }(a_{1,2},a_{1,1}) & q_{14 }(a_{1,2},a_{1,2}) & q_{15 }(a_{1,2},a_{1,3}) & q_{16 }(a_{1,2},t_1) & q_{17 }(a_{1,2},a_{2,1}) & \ldots & q_{24 }(a_{1,2},t_3) \\
45  q_{25 }(a_{1,3},a_{1,1}) & q_{26 }(a_{1,3},a_{1,2}) & q_{27 }(a_{1,3},a_{1,3}) & q_{28 }(a_{1,3},t_1) & q_{29 }(a_{1,3},a_{2,1}) & \ldots & q_{36 }(a_{1,3},t_3) \\
46  q_{37 }(t_{1 },a_{1,1}) & q_{38 }(t_{1 },a_{1,2}) & q_{39 }(t_{1 },a_{1,3}) & q_{40 }(t_{1 },t_1) & q_{41 }(t_{1 },a_{2,1}) & \ldots & q_{48 }(t_{1 },t_3) \\
47  q_{49 }(a_{2,1},a_{1,1}) & q_{50 }(a_{2,1},a_{1,2}) & q_{51 }(a_{2,1},a_{1,3}) & q_{52 }(a_{2,1},t_1) & q_{53 }(a_{2,1},a_{2,1}) & \ldots & q_{60 }(a_{2,1},t_3) \\
48  \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\
49  q_{133}(t_{3 },a_{1,1}) & q_{134}(t_{3 },a_{1,2}) & q_{135}(t_{3 },a_{1,3}) & q_{136}(t_{3 },t_1) & q_{137}(t_{3 },a_{2,1}) & \ldots & q_{144}(t_{3 },t_3) \\
50  \end{pmatrix}
51  \f]
52 
53  \author GM, AH
54  \date 10.11.2009
55  */
56  class OPALS_API TrafPars3dAffine : public CustomOptionType<TrafPars3dAffine>
57  {
58  public:
59  typedef Array<double,3> ArrayD3; ///< point coordinate array
60  typedef Array<double,12> ArrayD12; ///< transformation parameters array
61  typedef Array<double,144> ArrayD144; ///< QXX matrix array
62 
63  public:
65  virtual ~TrafPars3dAffine();
66 
67  /// \name procMode
68  /// processing mode (local, continuous, global) \see LSMProcMode
69  ///@{
70  void setProcMode( const LSMProcMode::Type& mode ) { lsmMode = mode; }
71  const LSMProcMode::Type& getProcMode() const { return lsmMode; }
72  ///}@
73 
74  /// \name IdGridMov
75  /// (alpha-numerical) grid ID of movable dataset
76  ///@{
77  void setIdGridMov( const String& id ) { idGridMov = id; }
78  const String& getIdGridMov() const { return idGridMov; }
79  ///}@
80 
81  /// \name IdGridFix
82  /// (alpha-numerical) grid ID of fixed dataset
83  ///@{
84  void setIdGridFix( const String& id ) { idGridFix = id; }
85  const String& getIdGridFix() const { return idGridFix; }
86  ///}@
87 
88  /// \name RefPointMov
89  /// coordinates of reference point of movable dataset
90  ///@{
91  void setRefPointMov( const ArrayD3& refPt ) { refPointMov = refPt; }
92  const ArrayD3& getRefPointMov() const { return refPointMov; }
93  ///}@
94 
95  /// \name RefPointFix
96  /// coordinates of (optional) reference point of fixed dataset
97  ///@{
98  void setRefPointFix( const ArrayD3& refPt ) { refPointFix = refPt; }
99  const ArrayD3& getRefPointFix() const { return refPointFix; }
100  ///}@
101 
102  /// \name TrafPars
103  /// transformation parameters arrray
104  ///@{
105  void setTrafPars( const ArrayD12& trfPars ) { trafPars = trfPars; }
106  const ArrayD12& getTrafPars() const { return trafPars; }
107  ///}@
108 
109  /// \name Qxx
110  /// \f$Q_{xx}\f$ maxtrix array (12*12)
111  ///@{
112  void setQxx( const ArrayD144& myQxx ) { qxx = myQxx; }
113  const ArrayD144& getQxx() const { return qxx; }
114  ///}@
115 
116  /// \name sigma_0
117  /// \f$\sigma_0\f$ of traf pars estimation
118  ///@{
119  void setSigma0( const double& sig0 ) { sigma0 = sig0; }
120  const double& getSigma0() const { return sigma0; }
121  ///}@
122 
123  /// \name nrObs
124  /// number of observations used for traf pars estimation
125  ///@{
126  void setNrObs( const unsigned& nob ) { nrObs = nob; }
127  const unsigned& getNrObs() const { return nrObs; }
128  ///}@
129 
130  /// \name relativeTrafo
131  /// whether the parameter denotes a relative transformation between two strips
132  /** TrafPars3dAffine can either be used to specify the best fitting transformation
133  between to overlapping ALS strips or in a global sense (after strip adjustment)
134  The (optional) members s_idGridFix/refPointFix are used to communicate
135  information about the strip used for the traf pars estimation. No such info
136  is provided in case of global transformation parameters. */
137  ///@{
138  bool relativeTrafo() const { return idGridFix.size()>0; }
139  ///}@
140 
141  static bool exportsPythonType();
142  static const char * help();
143  static const char * syntax();
144 
145  private:
146  LSMProcMode::Type lsmMode;
147  String idGridMov;
148  String idGridFix;
149  Array<double,3> refPointMov;
150  Array<double,3> refPointFix;
151  Array<double,12> trafPars;
153  double sigma0;
154  unsigned nrObs;
155  };
156 
157 }
158 
159 #endif