segframe.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 SegFrame_h
#define SegFrame_h
#include <vector>
#include <mia/2d/segstar.hh>
#include <mia/2d/segsection.hh>
#include <mia/2d/image.hh>
NS_MIA_BEGIN
class EXPORT_2D CSegFrame
{
public:
typedef std::vector<CSegSection> Sections;
typedef std::pair<float, float> Statistics;
typedef std::vector<Statistics> SectionsStats;
CSegFrame();
CSegFrame(const std::string& image, const CSegStar& star, const Sections& sections);
CSegFrame(const CXMLElement& node, int version);
const std::string& get_imagename() const;
void set_imagename(const std::string& name);
void rename_base(const std::string& new_base);
const Sections& get_sections() const;
void set_image(P2DImage image);
const CSegStar& get_star() const;
const C2DBoundingBox get_boundingbox() const;
void write(CXMLElement& node, int version) const;
void shift(const C2DFVector& delta, const std::string& cropped_file);
void transform(const C2DTransformation& t);
void inv_transform(const C2DTransformation& t);
float get_hausdorff_distance(const CSegFrame& other) const;
C2DUBImage get_section_masks(const C2DBounds& size) const;
C2DUBImage get_section_masks() const;
C2DUBImage get_section_masks(size_t n_sections) const;
SectionsStats get_stats(const C2DUBImage& mask) const;
SectionsStats get_stats(size_t n_sections) const;
size_t get_nsections() const;
float get_quality() const;
float get_brightness() const;
float get_contrast() const;
void set_quality(float q);
void set_brightness(float b);
void set_contrast(float c);
private:
void load_image() const;
bool m_has_star;
CSegStar m_star;
Sections m_sections;
std::string m_filename;
mutable P2DImage m_image;
float m_quality;
float m_brightness;
float m_contrast;
int m_version;
};
NS_MIA_END
#endif
image.hh
C2DUBImage
T2DImage< uint8_t > C2DUBImage
2D image with unsigned 8 bit integer values
Definition 2d/image.hh:448
P2DImage
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition 2d/image.hh:120
C2DBounds
T2DVector< unsigned int > C2DBounds
unsigned int valued 2D vector - used as 2D size parameter
Definition 2d/vector.hh:540
C2DFVector
T2DVector< float > C2DFVector
float valued 2D vector
Definition 2d/vector.hh:534
C2DBoundingBox
2D axis orthothogonal bounding box.
Definition boundingbox.hh:39
C2DTransformation
This is the generic base class for 2D transformations.
Definition 2d/transform.hh:46
CSegFrame::get_section_masks
C2DUBImage get_section_masks(size_t n_sections) const
CSegFrame::get_boundingbox
const C2DBoundingBox get_boundingbox() const
CSegFrame::set_imagename
void set_imagename(const std::string &name)
CSegFrame::set_quality
void set_quality(float q)
CSegFrame::transform
void transform(const C2DTransformation &t)
CSegFrame::get_hausdorff_distance
float get_hausdorff_distance(const CSegFrame &other) const
CSegFrame::get_brightness
float get_brightness() const
CSegFrame::Sections
std::vector< CSegSection > Sections
convenience typedef for the sections
Definition segframe.hh:43
CSegFrame::SectionsStats
std::vector< Statistics > SectionsStats
convenience typedef for the section statistics vector
Definition segframe.hh:51
CSegFrame::CSegFrame
CSegFrame()
CSegFrame::get_section_masks
C2DUBImage get_section_masks(const C2DBounds &size) const
CSegFrame::CSegFrame
CSegFrame(const std::string &image, const CSegStar &star, const Sections &sections)
CSegFrame::get_quality
float get_quality() const
CSegFrame::inv_transform
void inv_transform(const C2DTransformation &t)
CSegFrame::set_brightness
void set_brightness(float b)
CSegFrame::get_imagename
const std::string & get_imagename() const
CSegFrame::write
void write(CXMLElement &node, int version) const
CSegFrame::Statistics
std::pair< float, float > Statistics
Definition segframe.hh:48
CSegFrame::get_stats
SectionsStats get_stats(const C2DUBImage &mask) const
CSegFrame::get_section_masks
C2DUBImage get_section_masks() const
CSegFrame::CSegFrame
CSegFrame(const CXMLElement &node, int version)
CSegFrame::set_contrast
void set_contrast(float c)
CSegFrame::get_nsections
size_t get_nsections() const
CSegFrame::get_contrast
float get_contrast() const
CSegFrame::get_sections
const Sections & get_sections() const
CSegFrame::set_image
void set_image(P2DImage image)
CSegFrame::get_stats
SectionsStats get_stats(size_t n_sections) const
CSegFrame::shift
void shift(const C2DFVector &delta, const std::string &cropped_file)
CSegFrame::rename_base
void rename_base(const std::string &new_base)
CSegFrame::get_star
const CSegStar & get_star() const
CSegStar
Helper class for the segmentation of the left heart ventricle myocardium.
Definition segstar.hh:39
CXMLElement
This class implements a facade for the xml Element.
Definition xmlinterface.hh:50
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
load_image
T load_image(const std::string &filename)
Definition iohandler.hh:194
segsection.hh
segstar.hh