TShape< T, M > Class Template Reference

a generic class for morphological shapes More...

#include <mia/core/shape.hh>

Inheritance diagram for TShape< T, M >:
[legend]
Collaboration diagram for TShape< T, M >:
[legend]

Public Types

typedef Flat::const_iterator const_iterator
 iterator over the mask coordinate set More...
 
typedef std::set< T< int >, less_then< T< int > > > Flat
 
typedef M Mask
 the mask image type More...
 
typedef M::Super plugin_data
 Obtain the data type that is used for the mask image from the template parameters. More...
 
typedef shape_type plugin_type
 helper type for use of the class in TFactory More...
 
typedef T< unsigned int > Size
 the size type for the mask image More...
 
typedef T< int > value_type
 the actual value type of the mask coordinates More...
 
- Public Types inherited from CPropertyFlagHolder
typedef std::set< const char * > Set
 define the type of the set of flags More...
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
Mask get_mask () const
 
Size get_size () const
 returns the nD size of the mask More...
 
bool has_location (const T< int > &p) const
 
void insert (const T< int > &p)
 
Flat::size_type size () const
 
 TShape ()
 standard constructor initialises the shape set More...
 
- Public Member Functions inherited from CProductBase
const char * get_init_string () const
 
void set_init_string (const char *init)
 
void set_module (PPluginModule module)
 
- Public Member Functions inherited from CPropertyFlagHolder
void add (const char *property)
 
Set get_missing_properties (const CPropertyFlagHolder &testset) const
 
bool has (const char *property) const
 
bool has_all_in (const CPropertyFlagHolder &testset) const
 
virtual ~CPropertyFlagHolder ()
 

Detailed Description

template<template< typename > class T, typename M>
class TShape< T, M >

a generic class for morphological shapes

Pixel representation of shapes and masks around the origin. Type T is the coordinate class (e.g. T2DVector) and type M is the Mask image type, usually an binary image of the same dimensionallity as the coordinate class. For a specific instanciation, the user must provied a specialisation __adjust<T<int> > of the template defined in the shape.cxx, as well as a less_then<T<int> > specialisation. The implementation file of an instaciation must include shape.cxx, and must instanciate the TShape<T,M> with the user provided types T and M explicitely.

Definition at line 63 of file core/shape.hh.

Member Typedef Documentation

◆ const_iterator

template<template< typename > class T, typename M >
typedef Flat::const_iterator TShape< T, M >::const_iterator

iterator over the mask coordinate set

Definition at line 80 of file core/shape.hh.

◆ Flat

template<template< typename > class T, typename M >
typedef std::set< T<int>, less_then<T<int> > > TShape< T, M >::Flat

type to store the mask coordinates in a set to be able to easily iterate over it and avoid duplicate entries

Definition at line 74 of file core/shape.hh.

◆ Mask

template<template< typename > class T, typename M >
typedef M TShape< T, M >::Mask

the mask image type

Definition at line 83 of file core/shape.hh.

◆ plugin_data

template<template< typename > class T, typename M >
typedef M::Super TShape< T, M >::plugin_data

Obtain the data type that is used for the mask image from the template parameters.

Definition at line 69 of file core/shape.hh.

◆ plugin_type

template<template< typename > class T, typename M >
typedef shape_type TShape< T, M >::plugin_type

helper type for use of the class in TFactory

Definition at line 66 of file core/shape.hh.

◆ Size

template<template< typename > class T, typename M >
typedef T<unsigned int> TShape< T, M >::Size

the size type for the mask image

Definition at line 86 of file core/shape.hh.

◆ value_type

template<template< typename > class T, typename M >
typedef T<int> TShape< T, M >::value_type

the actual value type of the mask coordinates

Definition at line 77 of file core/shape.hh.

Constructor & Destructor Documentation

◆ TShape()

template<template< typename > class T, typename M >
TShape< T, M >::TShape ( )

standard constructor initialises the shape set

Member Function Documentation

◆ begin()

template<template< typename > class T, typename M >
const_iterator TShape< T, M >::begin ( ) const
Returns
the iterator to the begin of the shape

◆ end()

template<template< typename > class T, typename M >
const_iterator TShape< T, M >::end ( ) const
Returns
the iterator to the past end of the shape

◆ get_mask()

template<template< typename > class T, typename M >
Mask TShape< T, M >::get_mask ( ) const
Returns
an coordinate shifted image of the real mask

◆ get_size()

template<template< typename > class T, typename M >
Size TShape< T, M >::get_size ( ) const

returns the nD size of the mask

◆ has_location()

template<template< typename > class T, typename M >
bool TShape< T, M >::has_location ( const T< int > &  p) const

Test if a certain pixel location is set in the shape

Parameters
pthe pixel position
Returns
true if the pixel location is part of the shape

◆ insert()

template<template< typename > class T, typename M >
void TShape< T, M >::insert ( const T< int > &  p)

insert another pixel coordinate

Parameters
pthe pixel coordinate to be added

◆ size()

template<template< typename > class T, typename M >
Flat::size_type TShape< T, M >::size ( ) const
Returns
the number of points in the shape definition

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