CSegSection Class Reference
Perfusion Analysis

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

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

## Public Types

typedef std::vector< CSegPoint2D > | Points
| convenicence typedef for the points defining the section

## Public Member Functions

void | append_to (C2DPolygon &polygon) const
| CSegSection ()
| default constructor
| CSegSection (const CXMLElement &node, int version)
| CSegSection (const std::string &id, const Points &points, bool is_open)
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 Points & | get_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 47 of file segsection.hh.

## Constructor & Destructor Documentation

## CSegSection() [1/3]

CSegSection::CSegSection | ( |  | ) |

default constructor

Referenced by get_hausdorff_distance().

## 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

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

References is_open().

## CSegSection() [3/3]

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

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

Parameters

  node | root of the XML sub tree
  version | segmentation 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

  polygon | to 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

  output | image to draw to
  color | color 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

  output | image 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

References CSegSection().

## 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

  t | the inverse of the transformation to be applied

## is_open()

bool CSegSection::is_open | ( |  | ) | const

Returns
  whether the curve is open (true) or closed (false).

Referenced by CSegSection().

## 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

  t | the transformation to be applied

## write()

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

Store the segmented section into a XML sub-tree

Parameters

  node | parent node to which the subtree should be added
  version | segmentation set version the node stems from.

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

- segsection.hh