CSegSection Class Reference

Segmentation class to represent a section of the LV myocardium. More...

#include <mia/2d/segsection.hh>

Public Types

typedef std::vector< CSegPoint2DPoints
 convenicence typedef for the points defining the section More...
 

Public Member Functions

void append_to (C2DPolygon &polygon) const
 
 CSegSection ()
 default constructor More...
 
 CSegSection (const std::string &id, const Points &points, bool is_open)
 
 CSegSection (const CXMLElement &node, int version)
 
void draw (C2DUBImage &output, unsigned char color) const
 
void draw_xor (C2DUBImage &output) const
 
const C2DBoundingBox get_boundingbox () const
 
float get_hausdorff_distance (const CSegSection &other) const
 
const std::string & get_id () const
 
const Pointsget_points () const
 
void inv_transform (const C2DTransformation &t)
 
bool is_open () const
 
void shift (const C2DFVector &delta)
 
void transform (const C2DTransformation &t)
 
void write (CXMLElement &node, int version) const
 

Detailed Description

Segmentation class to represent a section of the LV myocardium.

Structure to save the segmentation of a section of the myocardium. In theory this can be used for any king of segmentation that uses a polynom to approximate a segmented 2D shape.

Definition at line 43 of file segsection.hh.

Member Typedef Documentation

◆ Points

typedef std::vector<CSegPoint2D> CSegSection::Points

convenicence typedef for the points defining the section

Definition at line 46 of file segsection.hh.

Constructor & Destructor Documentation

◆ CSegSection() [1/3]

CSegSection::CSegSection ( )

default constructor

◆ CSegSection() [2/3]

CSegSection::CSegSection ( const std::string &  id,
const Points points,
bool  is_open 
)

Constructor to create a segmentation shape and naming it

Parameters
idID of the section (and color identifier)
pointsthe points that define a closed polynom representing the shape
is_opendescribes if points should be interpreted as polygon (i.e. the last point connects to the first), or as poly-line only.

◆ CSegSection() [3/3]

CSegSection::CSegSection ( const CXMLElement node,
int  version 
)

Constructor to create a segmentation shape based on a XML sub tree

Parameters
noderoot of the XML sub tree
versionsegmentation set version the node stems from.

Member Function Documentation

◆ append_to()

void CSegSection::append_to ( C2DPolygon polygon) const

Append this shape to another shape, a very crude version of a logical or

Parameters
polygonto add the shape to

◆ draw()

void CSegSection::draw ( C2DUBImage output,
unsigned char  color 
) const

Draw the shape to a 2D image with a given color

Parameters
outputimage to draw to
colorcolor to use

◆ draw_xor()

void CSegSection::draw_xor ( C2DUBImage output) const

Draw the binary shape to a 2D image by xor-ing with what is already in there

Parameters
outputimage to draw to

◆ get_boundingbox()

const C2DBoundingBox CSegSection::get_boundingbox ( ) const
Returns
the orthogonal bounding box enclosing the shape

◆ get_hausdorff_distance()

float CSegSection::get_hausdorff_distance ( const CSegSection other) const

Evaluate the Hausdorff distance between this shape and another one

Parameters
other
Returns
the Hausdorff distance

◆ get_id()

const std::string& CSegSection::get_id ( ) const
Returns
the ID of the section

◆ get_points()

const Points& CSegSection::get_points ( ) const
Returns
the list of the points defining the section shape

◆ inv_transform()

void CSegSection::inv_transform ( const C2DTransformation t)

transform the shape by transforming its individual points

Parameters
tthe inverse of the transformation to be applied

◆ is_open()

bool CSegSection::is_open ( ) const
Returns
whether the curve is open (true) or closed (false).

◆ shift()

void CSegSection::shift ( const C2DFVector delta)

translate the segmentation by a given shift

Parameters
delta

◆ transform()

void CSegSection::transform ( const C2DTransformation t)

transform the shape by transforming its individual points

Parameters
tthe transformation to be applied

◆ write()

void CSegSection::write ( CXMLElement node,
int  version 
) const

Store the segmented section into a XML sub-tree

Parameters
nodeparent node to which the subtree should be added
versionsegmentation set version the node stems from.

The documentation for this class was generated from the following file: