STIR 6.4.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__
17
22
23START_NAMESPACE_STIR
50class RigidObject3DMotionFromPolaris
51 : public RegisteredParsingObject<RigidObject3DMotionFromPolaris, RigidObject3DMotion, RigidObject3DMotion>
52
53{
54public:
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
63 RigidObject3DMotionFromPolaris();
64
65 RigidObject3DTransformation compute_average_motion_in_tracker_coords_rel_time(const double start_time,
66 const double end_time) const override;
67
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
100private:
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
113private:
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
135END_NAMESPACE_STIR
136#endif
Declaration of class stir::CListModeData.
Declaration of class stir::Polaris_MT_File.
Declaration of class stir::RegisteredParsingObject.
Declaration of class stir::RigidObject3DMotion.
The base class for reading PET (i.e. coincidence) list mode data.
Definition CListModeData.h:51
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
void set_mask_for_tags(const unsigned int mask_for_tags)
set mask to be able to ignore one or more channels in the listmode gating data
Definition RigidObject3DMotionFromPolaris.cxx:484
void set_max_time_drift_deviation(const double v)
Sets boundaries to determine when the time drift is too large.
Definition RigidObject3DMotionFromPolaris.h:98
Succeeded synchronise() override
Synchronise motion tracking file and listmode file.
Definition RigidObject3DMotionFromPolaris.cxx:490
double get_max_time_drift_deviation() const
Gets boundaries to determine when the time drift is too large.
Definition RigidObject3DMotionFromPolaris.h:96
RigidObject3DTransformation get_motion_in_tracker_coords_rel_time(const double time) const override
get motion in tracker coordinates
Definition RigidObject3DMotionFromPolaris.cxx:249
void set_defaults() override
Set defaults before parsing.
Definition RigidObject3DMotionFromPolaris.cxx:731
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
double get_max_time_offset_deviation() const
Gets boundaries to determine when the time offset is out of bounds.
Definition RigidObject3DMotionFromPolaris.h:91
std::vector< double > get_rel_time_of_samples(const double start_time, const double end_time) const override
Info on when the motion was determined.
Definition RigidObject3DMotionFromPolaris.cxx:171
static RigidObject3DTransformation make_transformation_from_polaris_data(Polaris_MT_File::Record const &record)
Convert from Polaris transformation to STIR conventions.
Definition RigidObject3DMotionFromPolaris.cxx:99
static const char *const registered_name
Name which will be used when parsing a MotionTracking object.
Definition RigidObject3DMotionFromPolaris.h:56
void initialise_keymap() override
Initialise all keywords.
Definition RigidObject3DMotionFromPolaris.cxx:748
bool post_processing() override
This will be called at the end of the parsing.
Definition RigidObject3DMotionFromPolaris.cxx:763
Class to perform rigid object transformations in 3 dimensions.
Definition RigidObject3DTransformation.h:66
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44