template/trackpoint.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_template_trackpoint_hh
#define mia_template_trackpoint_hh
#include <istream>
#include <ostream>
#include <mia/core/import_handler.hh>
NS_MIA_BEGIN
template <typename Transformation>
class EXPORT_HANDLER TTrackPoint
{
public:
typedef typename Transformation::Vector Vector;
TTrackPoint();
TTrackPoint(int id, float time, const Vector& pos, const std::string& reserved);
bool read(std::string& is);
void print(std::ostream& os) const;
void move(float timestep, const Transformation& t);
const Vector& get_pos() const;
int get_id() const;
float get_time() const;
const std::string& get_reserved() const;
static std::vector< TTrackPoint > load_trackpoints(const std::string& in_filename);
private:
int m_id;
float m_time;
Vector m_pos;
std::string m_reserved;
};
template <typename Transformation>
std::ostream& operator << (std::ostream& os, const TTrackPoint<Transformation>& tp)
{
tp.print(os);
return os;
}
NS_MIA_END
#endif
TTrackPoint
Class to track pixel movement based on a transformation.
Definition template/trackpoint.hh:42
TTrackPoint::move
void move(float timestep, const Transformation &t)
TTrackPoint< C2DTransformation >::Vector
C2DTransformation::Vector Vector
Definition template/trackpoint.hh:44
TTrackPoint::print
void print(std::ostream &os) const
TTrackPoint::read
bool read(std::string &is)
TTrackPoint::load_trackpoints
static std::vector< TTrackPoint > load_trackpoints(const std::string &in_filename)
TTrackPoint::TTrackPoint
TTrackPoint(int id, float time, const Vector &pos, const std::string &reserved)
TTrackPoint::get_reserved
const std::string & get_reserved() const
returns the reserved field
TTrackPoint::get_time
float get_time() const
TTrackPoint::get_id
int get_id() const
TTrackPoint::TTrackPoint
TTrackPoint()
TTrackPoint::get_pos
const Vector & get_pos() const
Transformation
generic base class for transformations
Definition transformation.hh:45
EXPORT_HANDLER
#define EXPORT_HANDLER
Definition core/cost.hh:32
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
import_handler.hh
operator<<
std::ostream & operator<<(std::ostream &os, const TTrackPoint< Transformation > &tp)
Definition template/trackpoint.hh:110