segsection.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 SegSection_h
22 #define SegSection_h
23 
24 #include <vector>
25 #include <string>
26 
27 #include <mia/2d/segpoint.hh>
28 #include <mia/2d/boundingbox.hh>
29 #include <mia/2d/polygon.hh>
30 
32 
44 public:
46  typedef std::vector<CSegPoint2D> Points;
47 
49  CSegSection();
50 
58  CSegSection(const std::string& id, const Points& points, bool is_open);
59 
65  CSegSection(const CXMLElement& node, int version);
66 
72  void write(CXMLElement& node, int version) const;
73 
75  const std::string& get_id() const;
76 
78  const Points& get_points()const;
79 
81  const C2DBoundingBox get_boundingbox() const;
82 
87  void shift(const C2DFVector& delta);
88 
94  float get_hausdorff_distance(const CSegSection& other) const;
95 
100  void append_to(C2DPolygon& polygon)const;
101 
106  void transform(const C2DTransformation& t);
107 
112  void inv_transform(const C2DTransformation& t);
113 
119  void draw(C2DUBImage& output, unsigned char color)const;
120 
125  void draw_xor(C2DUBImage& output)const;
126 
128  bool is_open() const;
129 
130 private:
131  std::string m_id;
132  Points m_points;
133  bool m_is_open;
134 };
135 
137 
138 #endif
A simple 2D polygon class.
Definition: polygon.hh:39
std::vector< CSegPoint2D > Points
convenicence typedef for the points defining the section
Definition: segsection.hh:46
This is the template version of a 2D image that is used for holding real data.
Definition: 2d/image.hh:138
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_2D
Definition: defines2d.hh:37
Segmentation class to represent a section of the LV myocardium.
Definition: segsection.hh:43
This is the generic base class for 2D transformations.
Definition: 2d/transform.hh:45
2D axis orthothogonal bounding box.
Definition: boundingbox.hh:38
This class implements a facade for the xml Element.
Definition: xmlinterface.hh:49
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36