My Project
segframe.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 SegFrame_h
22 #define SegFrame_h
23 
24 #include <vector>
25 #include <mia/2d/segstar.hh>
26 #include <mia/2d/segsection.hh>
27 #include <mia/2d/image.hh>
28 
30 
40 {
41 public:
43  typedef std::vector<CSegSection> Sections;
44 
48  typedef std::pair<float, float> Statistics;
49 
51  typedef std::vector<Statistics> SectionsStats;
52 
53 
55 
62  CSegFrame(const std::string& image, const CSegStar& star, const Sections& sections);
63 
69  CSegFrame(const CXMLElement& node, int version);
70 
72  const std::string& get_imagename() const;
73 
77  void set_imagename(const std::string& name);
78 
83  void rename_base(const std::string& new_base);
84 
86  const Sections& get_sections() const;
87 
92  void set_image(P2DImage image);
93 
97  const CSegStar& get_star() const;
98 
101 
102 
108  void write(CXMLElement& node, int version) const;
109 
116  void shift(const C2DFVector& delta, const std::string& cropped_file);
117 
118 
123  void transform(const C2DTransformation& t);
124 
130 
136  float get_hausdorff_distance(const CSegFrame& other) const;
137 
138 
148 
154 
165  C2DUBImage get_section_masks(size_t n_sections) const;
166 
167 
174  SectionsStats get_stats(const C2DUBImage& mask) const;
175 
182  SectionsStats get_stats(size_t n_sections) const;
183 
187  size_t get_nsections() const;
188 
192  float get_quality() const;
193 
197  float get_brightness() const;
198 
202  float get_contrast() const;
203 
204 
209  void set_quality(float q);
210 
215  void set_brightness(float b);
216 
221  void set_contrast(float c);
222 
223 private:
224  void load_image() const;
225 
226  bool m_has_star;
227  CSegStar m_star;
228  Sections m_sections;
229  std::string m_filename;
230  mutable P2DImage m_image;
231 
232  float m_quality;
233  float m_brightness;
234  float m_contrast;
235  int m_version;
236 };
237 
239 
240 #endif
241 
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition: 2d/image.hh:120
2D axis orthothogonal bounding box.
Definition: boundingbox.hh:39
This is the generic base class for 2D transformations.
Definition: 2d/transform.hh:46
A class to represent one segmented frame in a heart perfusion series.
Definition: segframe.hh:40
C2DUBImage get_section_masks(size_t n_sections) const
const C2DBoundingBox get_boundingbox() const
void set_imagename(const std::string &name)
void set_quality(float q)
void transform(const C2DTransformation &t)
float get_hausdorff_distance(const CSegFrame &other) const
float get_brightness() const
std::vector< CSegSection > Sections
convenience typedef for the sections
Definition: segframe.hh:43
std::vector< Statistics > SectionsStats
convenience typedef for the section statistics vector
Definition: segframe.hh:51
C2DUBImage get_section_masks(const C2DBounds &size) const
CSegFrame(const std::string &image, const CSegStar &star, const Sections &sections)
const std::string & get_imagename() const
float get_quality() const
void inv_transform(const C2DTransformation &t)
void set_brightness(float b)
void write(CXMLElement &node, int version) const
std::pair< float, float > Statistics
Definition: segframe.hh:48
const CSegStar & get_star() const
SectionsStats get_stats(const C2DUBImage &mask) const
C2DUBImage get_section_masks() const
const Sections & get_sections() const
CSegFrame(const CXMLElement &node, int version)
void set_contrast(float c)
size_t get_nsections() const
float get_contrast() const
void set_image(P2DImage image)
SectionsStats get_stats(size_t n_sections) const
void shift(const C2DFVector &delta, const std::string &cropped_file)
void rename_base(const std::string &new_base)
Helper class for the segmentation of the left heart ventricle myocardium.
Definition: segstar.hh:39
This class implements a facade for the xml Element.
Definition: xmlinterface.hh:50
This is the template version of a 2D image that is used for holding real data.
Definition: 2d/image.hh:140
#define EXPORT_2D
Definition: defines2d.hh:37
#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
T load_image(const std::string &filename)
Definition: iohandler.hh:194