template/trackpoint.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef mia_template_trackpoint_hh
22 #define mia_template_trackpoint_hh
23 
24 #include <istream>
25 #include <ostream>
26 
28 
30 
40 template <typename Transformation>
42 public:
43  typedef typename Transformation::Vector Vector;
44 
45 
46  TTrackPoint();
47 
57  TTrackPoint(int id, float time, const Vector& pos, const std::string& reserved);
58 
65  bool read(std::string& is);
66 
71  void print(std::ostream& os) const;
72 
78  void move(float timestep, const Transformation& t);
79 
80 
82  const Vector& get_pos() const;
83 
85  int get_id() const;
86 
88  float get_time() const;
89 
91  const std::string& get_reserved() const;
92 
99  static std::vector< TTrackPoint > load_trackpoints(const std::string& in_filename);
100 
101 private:
102  int m_id;
103  float m_time;
104  Vector m_pos;
105  std::string m_reserved;
106 };
107 
108 template <typename Transformation>
109 std::ostream& operator << (std::ostream& os, const TTrackPoint<Transformation>& tp)
110 {
111  tp.print(os);
112  return os;
113 }
114 
115 
117 
118 
119 
120 #endif
Class to track pixel movement based on a transformation.
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_HANDLER
Definition: core/cost.hh:32
generic base class for transformations
Transformation::Vector Vector
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36