CSegFrame Class Reference
Perfusion Analysis

A class to represent one segmented frame in a heart perfusion series. More...

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

## Public Types

typedef std::vector< CSegSection > | Sections
| convenience typedef for the sections
typedef std::vector< Statistics > | SectionsStats
| convenience typedef for the section statistics vector
typedef std::pair< float, float > | Statistics

## Public Member Functions

| CSegFrame ()
| CSegFrame (const CXMLElement &node, int version)
| CSegFrame (const std::string &image, const CSegStar &star, const Sections &sections)
const C2DBoundingBox | get_boundingbox () const
float | get_brightness () const
float | get_contrast () const
float | get_hausdorff_distance (const CSegFrame &other) const
const std::string & | get_imagename () const
size_t | get_nsections () const
float | get_quality () const
C2DUBImage | get_section_masks () const
C2DUBImage | get_section_masks (const C2DBounds &size) const
C2DUBImage | get_section_masks (size_t n_sections) const
const Sections & | get_sections () const
const CSegStar & | get_star () const
SectionsStats | get_stats (const C2DUBImage &mask) const
SectionsStats | get_stats (size_t n_sections) const
void | inv_transform (const C2DTransformation &t)
void | rename_base (const std::string &new_base)
void | set_brightness (float b)
void | set_contrast (float c)
void | set_image (P2DImage image)
void | set_imagename (const std::string &name)
void | set_quality (float q)
void | shift (const C2DFVector &delta, const std::string &cropped_file)
void | transform (const C2DTransformation &t)
void | write (CXMLElement &node, int version) const

## Detailed Description

A class to represent one segmented frame in a heart perfusion series.

This class implements the frame of a myocardial segmentation consisting of six sections CSegsection, the segmentation helper CSegStar, and the name of the corresponding image file.

Definition at line 39 of file segframe.hh.

## Member Typedef Documentation

## Sections

typedef std::vector<CSegSection> CSegFrame::Sections

convenience typedef for the sections

Definition at line 43 of file segframe.hh.

## SectionsStats

typedef std::vector<Statistics> CSegFrame::SectionsStats

convenience typedef for the section statistics vector

Definition at line 51 of file segframe.hh.

## Statistics

typedef std::pair<float, float> CSegFrame::Statistics

convenience typedef for the statistics values

Remarks
  maybe a type with more meaningful elements would be better

Definition at line 48 of file segframe.hh.

## Constructor & Destructor Documentation

## CSegFrame() [1/3]

CSegFrame::CSegFrame | ( |  | ) |

Referenced by get_hausdorff_distance().

## CSegFrame() [2/3]

CSegFrame::CSegFrame | ( | const std::string & | image,
|  | const CSegStar & | star,
|  | const Sections & | sections )

Construct the segmentation frame from

Parameters

  image | image file name
  star | CSegStar
  sections | the segmentation sections

## CSegFrame() [3/3]

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

Construct the segmentation frame from a XML root node

Parameters

  node |
  version | segmentation set version the node stems from.

## Member Function Documentation

## get_boundingbox()

const C2DBoundingBox CSegFrame::get_boundingbox | ( |  | ) | const

Returns
  the bounding box enclosing all segmentation sections belonging to thie frame

## get_brightness()

float CSegFrame::get_brightness | ( |  | ) | const

Returns
  proposed brightness correction

## get_contrast()

float CSegFrame::get_contrast | ( |  | ) | const

Returns
  proposed contrast correction

## get_hausdorff_distance()

float CSegFrame::get_hausdorff_distance | ( | const CSegFrame & | other | ) | const

Evaluate the Hausdorff distance of this segmentation frame to another

Parameters

  other |

Returns
  Hausdorff distance

References CSegFrame().

## get_imagename()

const std::string & CSegFrame::get_imagename | ( |  | ) | const

Returns
  the file name of the corresponding image

## get_nsections()

size_t CSegFrame::get_nsections | ( |  | ) | const

Returns
  number of segmented sections

## get_quality()

float CSegFrame::get_quality | ( |  | ) | const

Returns
  slice quality rating

## get_section_masks() [1/3]

C2DUBImage CSegFrame::get_section_masks | ( |  | ) | const

Create the section masks by using the size of the image corresponding to the frame

Returns
  the mask image, for details see get_section_masks(const C2DBounds& size).

## get_section_masks() [2/3]

C2DUBImage CSegFrame::get_section_masks | ( | const C2DBounds & | size | ) | const

Evaluate a mask image based on the segmented sections

Parameters

  size | size of the output image

Returns
  an image containing the masks for each section numbered in the storage order of the sections

Remarks
  If overlap exists between the sections the masks with a higher index overwrite the masks with a lower index.

## get_section_masks() [3/3]

C2DUBImage CSegFrame::get_section_masks | ( | size_t | n_sections | ) | const

Create the section masks by using the size of the image corresponding to the frame. If the number of requested sections is equal to the number of sections stored, this call is equal to get_section_masks(), Otherwiese, instead of using the sections as defined, evaluate the union of all the sections and then split this union evenly in n_sections starting by the first directional ray and moving clockwiese with the star center as the angular point.

Parameters

  n_sections | number of target sections

Returns
  the mask image, for details see get_section_masks(const C2DBounds& size).

## get_sections()

const Sections & CSegFrame::get_sections | ( |  | ) | const

Returns
  a read-only reference to the segmentation sections

## get_star()

const CSegStar & CSegFrame::get_star | ( |  | ) | const

Returns
  the star of the LV contained in this frame

## get_stats() [1/2]

SectionsStats CSegFrame::get_stats | ( | const C2DUBImage & | mask | ) | const

Evaluate inetnsity mean and variation of the image data for the registions defined by the given mask image.

Parameters

  mask |

Returns
  the statustics

## get_stats() [2/2]

SectionsStats CSegFrame::get_stats | ( | size_t | n_sections | ) | const

Evaluate inetnsity mean and variation of the image data for the registions defined the get_section_masks(size_t n_sections) method.

Parameters

  n_sections |

Returns
  the statustics

## inv_transform()

void CSegFrame::inv_transform | ( | const C2DTransformation & | t | ) |

transform the frame segmentation by the inverse of the given transformation

Parameters

  t |

## rename_base()

void CSegFrame::rename_base | ( | const std::string & | new_base | ) |

rename the file name base of the image according to sed -e "s/.*[^0-9]\‍([0-9]*\..*\‍)/$new_base\1/"

Parameters

  new_base |

## set_brightness()

void CSegFrame::set_brightness | ( | float | b | ) |

set the brightness adjustment for the frame

Parameters

  b | 0=no adjustment

## set_contrast()

void CSegFrame::set_contrast | ( | float | c | ) |

set contrast adjustment

Parameters

  c | 0=no adjustment

## set_image()

void CSegFrame::set_image | ( | P2DImage | image | ) |

Set the image corresponding to the segmentation frame

Parameters

  image |

## set_imagename()

void CSegFrame::set_imagename | ( | const std::string & | name | ) |

set the file name of the corresponding image

Parameters

  name |

## set_quality()

void CSegFrame::set_quality | ( | float | q | ) |

set the quality rating for the frame

Parameters

  q | 0=not set, 1-5 worst to best

## shift()

void CSegFrame::shift | ( | const C2DFVector & | delta,
|  | const std::string & | cropped_file )

Shift the segmentation frame and change the file name to the new name corresponding to the shifted image

Parameters

  delta | translation
  cropped_file | new image file name

## transform()

void CSegFrame::transform | ( | const C2DTransformation & | t | ) |

transform the frame segmentation by a given transformation

Parameters

  t |

## write()

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

Append the segmentation frame to a XML node

Parameters

  node | parent node to append the frame description to
  version | segmentation set file version that should be used to save the data

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

- segframe.hh