My Project
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
40template <typename Transformation>
42{
43public:
44 typedef typename Transformation::Vector Vector;
45
46
48
58 TTrackPoint(int id, float time, const Vector& pos, const std::string& reserved);
59
66 bool read(std::string& is);
67
72 void print(std::ostream& os) const;
73
79 void move(float timestep, const Transformation& t);
80
81
83 const Vector& get_pos() const;
84
86 int get_id() const;
87
89 float get_time() const;
90
92 const std::string& get_reserved() const;
93
100 static std::vector< TTrackPoint > load_trackpoints(const std::string& in_filename);
101
102private:
103 int m_id;
104 float m_time;
105 Vector m_pos;
106 std::string m_reserved;
107};
108
109template <typename Transformation>
110std::ostream& operator << (std::ostream& os, const TTrackPoint<Transformation>& tp)
111{
112 tp.print(os);
113 return os;
114}
115
116
118
119
120
121#endif
Class to track pixel movement based on a transformation.
void move(float timestep, const Transformation &t)
Transformation::Vector Vector
void print(std::ostream &os) const
bool read(std::string &is)
static std::vector< TTrackPoint > load_trackpoints(const std::string &in_filename)
TTrackPoint(int id, float time, const Vector &pos, const std::string &reserved)
const std::string & get_reserved() const
returns the reserved field
float get_time() const
int get_id() const
const Vector & get_pos() const
generic base class for transformations
#define EXPORT_HANDLER
Definition: core/cost.hh:32
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
std::ostream & operator<<(std::ostream &os, const TTrackPoint< Transformation > &tp)