My Project
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 {
45 public:
47  typedef std::vector<CSegPoint2D> Points;
48 
50  CSegSection();
51 
59  CSegSection(const std::string& id, const Points& points, bool is_open);
60 
66  CSegSection(const CXMLElement& node, int version);
67 
73  void write(CXMLElement& node, int version) const;
74 
76  const std::string& get_id() const;
77 
79  const Points& get_points()const;
80 
82  const C2DBoundingBox get_boundingbox() const;
83 
88  void shift(const C2DFVector& delta);
89 
95  float get_hausdorff_distance(const CSegSection& other) const;
96 
101  void append_to(C2DPolygon& polygon)const;
102 
107  void transform(const C2DTransformation& t);
108 
113  void inv_transform(const C2DTransformation& t);
114 
120  void draw(C2DUBImage& output, unsigned char color)const;
121 
126  void draw_xor(C2DUBImage& output)const;
127 
129  bool is_open() const;
130 
131 private:
132  std::string m_id;
133  Points m_points;
134  bool m_is_open;
135 };
136 
138 
139 #endif
boundingbox.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
C2DBoundingBox
2D axis orthothogonal bounding box.
Definition: boundingbox.hh:38
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
CSegSection
Segmentation class to represent a section of the LV myocardium.
Definition: segsection.hh:43
CXMLElement
This class implements a facade for the xml Element.
Definition: xmlinterface.hh:49
T2DVector< float >
CSegSection::Points
std::vector< CSegPoint2D > Points
convenicence typedef for the points defining the section
Definition: segsection.hh:47
C2DTransformation
This is the generic base class for 2D transformations.
Definition: 2d/transform.hh:45
polygon.hh
C2DPolygon
A simple 2D polygon class.
Definition: polygon.hh:39
T2DImage
This is the template version of a 2D image that is used for holding real data.
Definition: 2d/image.hh:139
CCmdOptionFlags::output
@ output
segpoint.hh
EXPORT_2D
#define EXPORT_2D
Definition: defines2d.hh:37