MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
mds::img::CAdjacencyGraph< T > Class Template Reference

#include <mdsAdjacencyGraph.h>

Inheritance diagram for mds::img::CAdjacencyGraph< T >:
Inheritance graph
[legend]

List of all members.

Classes

struct  SRegionInfo
 Class representing one row of the Region Adjacency Graph (RAG). More...

Public Types

enum  { CLASS_OBJECT }
 Templates that require members of the CObject class can use this enum to check the existence. More...
enum  { HEAP_OBJECT = 0x70616568 }
 Signature used to recognize objects on the heap. More...
typedef
mds::base::CSTLIterator
< typename
SRegionInfo::tRow::const_iterator > 
tConstIterator
 Const iterator used to traverse all region neighbours.
typedef T tElement
 Type of the RAG element.
typedef
mds::base::CSTLIterator
< typename
SRegionInfo::tRow::iterator > 
tIterator
 Iterator used to traverse all region neighbours.
typedef std::vector< SRegionInfotRAG
 Internal representation of the RAG.

Public Member Functions

 CAdjacencyGraph (tSize NumOfRegions)
 Default constructor.
void clear (tSize i)
 Removes all elements of the RAG corresponding to given region index.
void clear ()
 Removes all elements from the RAG.
get (tSize i, tSize j, const T &DefaultValue) const
 Returns value of the subscripted element.
getMax (tSize &i, tSize &j, const T &DefaultValue)
 Returns value and region labels of the maximal RAG element.
getMin (tSize &i, tSize &j, const T &DefaultValue)
 Returns value and region labels of the minimal RAG element.
SRegionInfo::tRowgetNeighbours (tSize i)
 Returns reference to the container of all neighbours of i-th region.
const SRegionInfo::tRowgetNeighbours (tSize i) const
tSize getNumOfRegions () const
 Returns the total number of regions.
int getReferencesCount () const
 Returns the number of references.
tSize getRegion (const tIterator &it)
 Returns the element region.
tSize getRegion (const tConstIterator &it) const
T & getValue (const tIterator &it)
 Returns element value.
const T & getValue (const tConstIterator &it) const
bool isOnHeap () const
 Returns true if the object is allocated on the heap.
 MDS_SHAREDPTR (CAdjacencyGraph)
 Smart pointer type.
void merge (tSize i, tSize j)
 Merges two specified regions.
void set (tSize i, tSize j, const T &Value)
 Sets subscripted RAG element.
void setNumOfRegions (tSize NumOfRegions)
 Sets number of regions in the RAG.
 ~CAdjacencyGraph ()
 Destructor.

Static Public Member Functions

static void * operator new (std::size_t Size)
 Allocates a new object on the heap.

Protected Member Functions

void addReference () const
 Increase the reference counter.
bool delReference () const
 Decrease the reference counter.
void findMinMax ()
 Finds maximum and minimum value.

Protected Attributes

int m_Flags
 Internal flags.
int m_iHeapObject
 Flag initialized if the object is on the heap.
int m_iReferences
 The number of references to the object.
m_Max
 Minimal and maximal value.
tSize m_MaxIndex
 Index of the row where the maximum can be found.
m_Min
tSize m_MinIndex
tRAG m_RAG
 The RAG stored as a sparse matrix in std::map.

template<typename T>
class mds::img::CAdjacencyGraph< T >


Member Typedef Documentation

template<typename T >
typedef mds::base::CSTLIterator<typename SRegionInfo::tRow::const_iterator> mds::img::CAdjacencyGraph< T >::tConstIterator

Const iterator used to traverse all region neighbours.

template<typename T >
typedef T mds::img::CAdjacencyGraph< T >::tElement

Type of the RAG element.

template<typename T >
typedef mds::base::CSTLIterator<typename SRegionInfo::tRow::iterator> mds::img::CAdjacencyGraph< T >::tIterator

Iterator used to traverse all region neighbours.

template<typename T >
typedef std::vector<SRegionInfo> mds::img::CAdjacencyGraph< T >::tRAG

Internal representation of the RAG.


Member Enumeration Documentation

anonymous enum [inherited]

Templates that require members of the CObject class can use this enum to check the existence.

Enumerator:
CLASS_OBJECT 
anonymous enum [inherited]

Signature used to recognize objects on the heap.

Enumerator:
HEAP_OBJECT 

Constructor & Destructor Documentation

template<typename T >
mds::img::CAdjacencyGraph< T >::CAdjacencyGraph ( tSize  NumOfRegions)

Default constructor.

template<typename T >
mds::img::CAdjacencyGraph< T >::~CAdjacencyGraph ( )

Destructor.


Member Function Documentation

void mds::base::CObject::addReference ( ) const [protected, inherited]

Increase the reference counter.

template<typename T >
void CAdjacencyGraph::clear ( tSize  i)

Removes all elements of the RAG corresponding to given region index.

template<typename T >
void CAdjacencyGraph::clear ( )

Removes all elements from the RAG.

bool mds::base::CObject::delReference ( ) const [protected, inherited]

Decrease the reference counter.

  • Returns true if the decremented number of references is lower or equal to zero and object must be deleted.
template<typename T >
void CAdjacencyGraph::findMinMax ( ) [protected]

Finds maximum and minimum value.

template<typename T >
T CAdjacencyGraph::get ( tSize  i,
tSize  j,
const T &  DefaultValue 
) const

Returns value of the subscripted element.

  • If the element is not found, a given default value is returned.
template<typename T >
T CAdjacencyGraph::getMax ( tSize i,
tSize j,
const T &  DefaultValue 
)

Returns value and region labels of the maximal RAG element.

template<typename T >
T CAdjacencyGraph::getMin ( tSize i,
tSize j,
const T &  DefaultValue 
)

Returns value and region labels of the minimal RAG element.

template<typename T >
SRegionInfo::tRow& mds::img::CAdjacencyGraph< T >::getNeighbours ( tSize  i)

Returns reference to the container of all neighbours of i-th region.

template<typename T >
const SRegionInfo::tRow& mds::img::CAdjacencyGraph< T >::getNeighbours ( tSize  i) const
template<typename T >
tSize mds::img::CAdjacencyGraph< T >::getNumOfRegions ( ) const

Returns the total number of regions.

Returns the number of references.

template<typename T >
tSize mds::img::CAdjacencyGraph< T >::getRegion ( const tIterator it)

Returns the element region.

template<typename T >
tSize mds::img::CAdjacencyGraph< T >::getRegion ( const tConstIterator it) const
template<typename T >
T& mds::img::CAdjacencyGraph< T >::getValue ( const tIterator it)

Returns element value.

template<typename T >
const T& mds::img::CAdjacencyGraph< T >::getValue ( const tConstIterator it) const
bool mds::base::CObject::isOnHeap ( ) const [inherited]

Returns true if the object is allocated on the heap.

template<typename T >
mds::img::CAdjacencyGraph< T >::MDS_SHAREDPTR ( CAdjacencyGraph< T >  )

Smart pointer type.

  • Declares type tSmartPtr.
template<typename T >
void CAdjacencyGraph::merge ( tSize  i,
tSize  j 
)

Merges two specified regions.

Adds the first region having index i to the second region j.

static void* mds::base::CObject::operator new ( std::size_t  Size) [static, inherited]

Allocates a new object on the heap.

template<typename T >
void CAdjacencyGraph::set ( tSize  i,
tSize  j,
const T &  Value 
)

Sets subscripted RAG element.

template<typename T >
void mds::img::CAdjacencyGraph< T >::setNumOfRegions ( tSize  NumOfRegions)

Sets number of regions in the RAG.


Member Data Documentation

template<typename T >
int mds::img::CAdjacencyGraph< T >::m_Flags [protected]

Internal flags.

int mds::base::CObject::m_iHeapObject [mutable, protected, inherited]

Flag initialized if the object is on the heap.

int mds::base::CObject::m_iReferences [mutable, protected, inherited]

The number of references to the object.

  • Zero if there is no reference.
template<typename T >
T mds::img::CAdjacencyGraph< T >::m_Max [protected]

Minimal and maximal value.

template<typename T >
tSize mds::img::CAdjacencyGraph< T >::m_MaxIndex [protected]

Index of the row where the maximum can be found.

template<typename T >
T mds::img::CAdjacencyGraph< T >::m_Min [protected]
template<typename T >
tSize mds::img::CAdjacencyGraph< T >::m_MinIndex [protected]
template<typename T >
tRAG mds::img::CAdjacencyGraph< T >::m_RAG [protected]

The RAG stored as a sparse matrix in std::map.


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