STIR  6.2.0
RigidObject3DTransformation.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000- 2005 , Hammersmith Imanet Ltd
5  For internal GE use only
6 */
16 #ifndef __stir_motion_RigidObject3DTransformation_H__
17 #define __stir_motion_RigidObject3DTransformation_H__
18 
23 #include "stir/Succeeded.h"
24 #include "stir/Array.h"
25 #include "stir/Bin.h"
26 #include "stir/ProjDataInfo.h"
27 #include <algorithm>
28 
29 START_NAMESPACE_STIR
30 class Succeeded;
31 
65  : public RegisteredParsingObject<RigidObject3DTransformation, ObjectTransformation<3, float>, ObjectTransformation<3, float>>
66 {
67 public:
68  static const char* const registered_name;
87  template <class Iter1T, class Iter2T>
88  static Succeeded find_closest_transformation(RigidObject3DTransformation& result,
89  Iter1T start_orig_points,
90  Iter1T end_orig_points,
91  Iter2T start_transformed_points,
92  const Quaternion<float>& initial_rotation = Quaternion<float>(1.F, 0.F, 0.F, 0.F));
93 
97  template <class Iter1T, class Iter2T>
98  static double RMSE(const RigidObject3DTransformation& transformation,
99  Iter1T start_orig_points,
100  Iter1T end_orig_points,
101  Iter2T start_transformed_points);
102 
104 
106 
107  RigidObject3DTransformation(const Quaternion<float>& quat, const CartesianCoordinate3D<float>& translation);
108 
110  RigidObject3DTransformation inverse() const;
112  Quaternion<float> get_quaternion() const;
113 
115  CartesianCoordinate3D<float> get_translation() const;
116 
117 #if 0
118  // implementation probably only works for FIRSTROT
120  Coordinate3D<float> get_euler_angles() const;
121 
122  Succeeded set_euler_angles();
123 #endif
124 
126  // can't return CartesianCoordinate3D<float> anymore because virtual function
127 
128  BasicCoordinate<3, float> transform_point(const BasicCoordinate<3, float>& point) const override;
129 
131  float jacobian(const BasicCoordinate<3, float>& point) const override
132  {
133  return 1;
134  }
135 
137 
141  void transform_bin(Bin& bin, const ProjDataInfo& out_proj_data_info, const ProjDataInfo& in_proj_data_info) const;
143  void get_relative_transformation(RigidObject3DTransformation& output, const RigidObject3DTransformation& reference);
144 #if 0
145 
149  static void quaternion_2_euler(Coordinate3D<float>& Euler_angles, const Quaternion<float>& quat);
151  static void quaternion_2_m3(Array<2,float>& mat, const Quaternion<float>& quat);
152  static void m3_2_euler(Coordinate3D<float>& Euler_angles, const Array<2,float>& mat);
154  static void euler_2_quaternion(Quaternion<float>& quat,const Coordinate3D<float>& Euler_angles);
156 #endif
157 
158 private:
159  Quaternion<float> quat;
160  CartesianCoordinate3D<float> translation;
162  const RigidObject3DTransformation& apply_first);
163 };
164 
166 
169 std::ostream& operator<<(std::ostream& out, const RigidObject3DTransformation& rigid_object_transformation);
171 
174 std::istream& operator>>(std::istream&, RigidObject3DTransformation& rigid_object_transformation);
175 
177 
191  const RigidObject3DTransformation& apply_first);
192 
193 END_NAMESPACE_STIR
194 
195 #endif
Declaration of class stir::Quaternion.
Declaration of class stir::Succeeded.
Declaration of class stir::ProjDataInfo.
Declaration of class stir::ObjectTransformation.
defines the Array class for multi-dimensional (numeric) arrays
Class to perform rigid object transformations in 3 dimensions.
Definition: RigidObject3DTransformation.h:64
RigidObject3DTransformation compose(const RigidObject3DTransformation &apply_last, const RigidObject3DTransformation &apply_first)
Composition of 2 transformations.
Definition: RigidObject3DTransformation.cxx:442
float jacobian(const BasicCoordinate< 3, float > &point) const override
Computes the jacobian for the transformation (which is always 1)
Definition: RigidObject3DTransformation.h:131
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
Declaration of class stir::Bin.
a templated class for 3-dimensional coordinates.
Definition: Coordinate3D.h:42
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordi...
Definition: BasicCoordinate.h:53
An (abstract base) class that contains information on the projection data.
Definition: ProjDataInfo.h:69
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
defines the stir::CartesianCoordinate3D<coordT> class
Declaration of class stir::RegisteredParsingObject.