STIR  6.2.0
RigidObject3DMotionFromPolaris.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2003- 2010, Hammersmith Imanet Ltd
5  For internal GE use only
6 */
7 #ifndef __stir_motion_RigidObject3DMotionFromPolaris__H__
8 #define __stir_motion_RigidObject3DMotionFromPolaris__H__
9 
22 
23 START_NAMESPACE_STIR
51  : public RegisteredParsingObject<RigidObject3DMotionFromPolaris, RigidObject3DMotion, RigidObject3DMotion>
52 
53 {
54 public:
56  static const char* const registered_name;
57 
59  /* see more info in .cxx file */
60  static RigidObject3DTransformation make_transformation_from_polaris_data(Polaris_MT_File::Record const& record);
61 
62  // only need this to enable LmToProjDataWithMC(const char * const par_filename) function
64 
65  RigidObject3DTransformation compute_average_motion_in_tracker_coords_rel_time(const double start_time,
66  const double end_time) const override;
67 
68  RigidObject3DTransformation get_motion_in_tracker_coords_rel_time(const double time) const override;
69 
70  std::vector<double> get_rel_time_of_samples(const double start_time, const double end_time) const override;
71 
73  void set_mask_for_tags(const unsigned int mask_for_tags);
74 
76  Succeeded synchronise() override;
77  double secs_since_1970_to_rel_time(std::time_t) const override;
78 
79  const RigidObject3DTransformation& get_transformation_to_scanner_coords() const override;
80  const RigidObject3DTransformation& get_transformation_from_scanner_coords() const override;
81  void set_transformation_from_scanner_coords(const RigidObject3DTransformation&) override;
82  Succeeded set_mt_file(const std::string& mt_filename);
83  Succeeded set_list_mode_data_file(const std::string& lm_filename);
84 
85  void set_defaults() override;
86  void initialise_keymap() override;
87  bool post_processing() override;
88 
90  //*! Currently, the time offset is compared to the start of the listmode scan.*/
91  double get_max_time_offset_deviation() const { return max_time_offset_deviation; }
93  void set_max_time_offset_deviation(const double v) { max_time_offset_deviation = v; }
95 
96  double get_max_time_drift_deviation() const { return max_time_drift_deviation; }
98  void set_max_time_drift_deviation(const double v) { max_time_drift_deviation = v; }
99 
100 private:
101  void do_synchronisation(CListModeData& listmode_data);
102  bool is_synchronised() const override;
103 
104  double rel_time_to_polaris_time(const double time) const;
105  double polaris_time_to_rel_time(const double time) const;
106 
107  RigidObject3DTransformation compute_average_motion_polaris_time(const double start_time, const double end_time) const;
108 
109  shared_ptr<Polaris_MT_File> mt_file_ptr;
110  std::string mt_filename;
111  std::string list_mode_filename;
112 
113 private:
115  unsigned int _mask_for_tags;
116 
117  // TODO this should probably be moved to RigidObject3DMotion
118  std::string transformation_from_scanner_coordinates_filename;
119  RigidObject3DTransformation move_to_scanner_coords;
120  RigidObject3DTransformation move_from_scanner_coords;
121 
122  double time_offset;
123  double time_drift;
124 
126  //*! Currently, the time offset is compared to the start of the listmode scan.*/
127  double max_time_offset_deviation;
129 
130  double max_time_drift_deviation;
131 
132  std::time_t listmode_data_start_time_in_secs;
133 };
134 
135 END_NAMESPACE_STIR
136 #endif
The base class for reading PET (i.e. coincidence) list mode data.The only difference w...
Definition: CListModeData.h:50
double get_max_time_offset_deviation() const
Gets boundaries to determine when the time offset is out of bounds.
Definition: RigidObject3DMotionFromPolaris.h:91
Class to perform rigid object transformations in 3 dimensions.
Definition: RigidObject3DTransformation.h:64
Declaration of class stir::CListModeData.
void set_max_time_drift_deviation(const double v)
Sets boundaries to determine when the time drift is too large.
Definition: RigidObject3DMotionFromPolaris.h:98
static const char *const registered_name
Name which will be used when parsing a MotionTracking object.
Definition: RigidObject3DMotionFromPolaris.h:56
Declaration of class stir::Polaris_MT_File.
double get_max_time_drift_deviation() const
Gets boundaries to determine when the time drift is too large.
Definition: RigidObject3DMotionFromPolaris.h:96
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Declaration of class stir::RigidObject3DMotion.
void set_max_time_offset_deviation(const double v)
Sets boundaries to determine when the time offset is out of bounds.
Definition: RigidObject3DMotionFromPolaris.h:93
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declaration of class stir::RegisteredParsingObject.
A class for handling motion information from the Polaris tracker.
Definition: RigidObject3DMotionFromPolaris.h:50