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