segsection.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 SegSection_h
#define SegSection_h
#include <vector>
#include <string>
#include <mia/2d/segpoint.hh>
#include <mia/2d/boundingbox.hh>
#include <mia/2d/polygon.hh>
NS_MIA_BEGIN
class EXPORT_2D CSegSection
{
public:
typedef std::vector<CSegPoint2D> Points;
CSegSection();
CSegSection(const std::string& id, const Points& points, bool is_open);
CSegSection(const CXMLElement& node, int version);
void write(CXMLElement& node, int version) const;
const std::string& get_id() const;
const Points& get_points()const;
const C2DBoundingBox get_boundingbox() const;
void shift(const C2DFVector& delta);
float get_hausdorff_distance(const CSegSection& other) const;
void append_to(C2DPolygon& polygon)const;
void transform(const C2DTransformation& t);
void inv_transform(const C2DTransformation& t);
void draw(C2DUBImage& output, unsigned char color)const;
void draw_xor(C2DUBImage& output)const;
bool is_open() const;
private:
std::string m_id;
Points m_points;
bool m_is_open;
};
NS_MIA_END
#endif
C2DUBImage
T2DImage< uint8_t > C2DUBImage
2D image with unsigned 8 bit integer values
Definition 2d/image.hh:448
C2DFVector
T2DVector< float > C2DFVector
float valued 2D vector
Definition 2d/vector.hh:534
boundingbox.hh
C2DBoundingBox
2D axis orthothogonal bounding box.
Definition boundingbox.hh:39
C2DPolygon
A simple 2D polygon class.
Definition polygon.hh:40
C2DTransformation
This is the generic base class for 2D transformations.
Definition 2d/transform.hh:46
CSegSection::get_id
const std::string & get_id() const
CSegSection::draw_xor
void draw_xor(C2DUBImage &output) const
CSegSection::get_hausdorff_distance
float get_hausdorff_distance(const CSegSection &other) const
CSegSection::CSegSection
CSegSection()
default constructor
CSegSection::draw
void draw(C2DUBImage &output, unsigned char color) const
CSegSection::get_points
const Points & get_points() const
CSegSection::CSegSection
CSegSection(const CXMLElement &node, int version)
CSegSection::inv_transform
void inv_transform(const C2DTransformation &t)
CSegSection::write
void write(CXMLElement &node, int version) const
CSegSection::Points
std::vector< CSegPoint2D > Points
convenicence typedef for the points defining the section
Definition segsection.hh:47
CSegSection::transform
void transform(const C2DTransformation &t)
CSegSection::append_to
void append_to(C2DPolygon &polygon) const
CSegSection::shift
void shift(const C2DFVector &delta)
CSegSection::CSegSection
CSegSection(const std::string &id, const Points &points, bool is_open)
CSegSection::is_open
bool is_open() const
CSegSection::get_boundingbox
const C2DBoundingBox get_boundingbox() const
CXMLElement
This class implements a facade for the xml Element.
Definition xmlinterface.hh:50
CCmdOptionFlags::output
@ output
Definition cmdoptionflags.hh:32
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
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
polygon.hh
segpoint.hh