MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class encapsulating mapping of labels for image blobs. More...
#include <mdsBlobLabeling.h>
Classes | |
struct | SInitLabel |
Function object used to initialize the mapping. More... | |
struct | SLabelInfo |
Information about a blob label. More... | |
Public Types | |
enum | { DEFAULT_SIZE = 4096 } |
Default size hint. More... | |
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 T | tData |
User specific data. | |
Public Member Functions | |
CBlobLabeling (int SizeHint=DEFAULT_SIZE) | |
Default constructor. | |
void | clear (int SizeHint=DEFAULT_SIZE) |
Clears the mapping. | |
tData & | getData (int i) |
Returns reference to user specific data. | |
int | getLabel (int i) |
Returns the label for a specified blob. | |
int | getReferencesCount () const |
Returns the number of references. | |
int | getSize () const |
Returns the current number of blobs. | |
bool | isOnHeap () const |
Returns true if the object is allocated on the heap. | |
MDS_SHAREDPTR (CBlobLabeling) | |
Smart pointer type. | |
void | merge (int i, int j) |
Modifies the mapping so that the two given blobs share the same label. | |
int | newLabel () |
Returns a new label. | |
int | newLabel (const tData &Data) |
Returns a new label. | |
void | relabel (int StartingValue=0) |
Re-orders labels so that there will be no gaps in the numbering. | |
~CBlobLabeling () | |
Destructor. | |
Static Public Member Functions | |
static void * | operator new (std::size_t Size) |
Allocates a new object on the heap. | |
Protected Types | |
typedef std::vector< SLabelInfo > | tLabels |
Mapping of labels. | |
Protected Member Functions | |
void | addReference () const |
Increase the reference counter. | |
bool | delReference () const |
Decrease the reference counter. | |
int | getRoot (int i) |
Finds root for a given blob. | |
bool | isEquivalent (int i, int j) |
Returns true if two given blobs have been merged. | |
bool | isRoot (int i) const |
Returns true if a subscripted blob is a root (its label is equal to the given blob number. | |
Protected Attributes | |
int | m_HighestLabel |
First available label. | |
int | m_iHeapObject |
Flag initialized if the object is on the heap. | |
int | m_iReferences |
The number of references to the object. | |
tLabels | m_Labels |
Class encapsulating mapping of labels for image blobs.
It allows you to modify the mapping, merge two blobs, etc. Such mapping is useful for algorithms like region growing or connected component labeling.
typedef T mds::img::CBlobLabeling< T >::tData |
User specific data.
typedef std::vector<SLabelInfo> mds::img::CBlobLabeling< T >::tLabels [protected] |
Mapping of labels.
anonymous enum [inherited] |
Templates that require members of the CObject class can use this enum to check the existence.
mds::img::CBlobLabeling< T >::CBlobLabeling | ( | int | SizeHint = DEFAULT_SIZE | ) |
Default constructor.
mds::img::CBlobLabeling< T >::~CBlobLabeling | ( | ) |
Destructor.
void mds::base::CObject::addReference | ( | ) | const [protected, inherited] |
Increase the reference counter.
void mds::img::CBlobLabeling< T >::clear | ( | int | SizeHint = DEFAULT_SIZE | ) |
Clears the mapping.
bool mds::base::CObject::delReference | ( | ) | const [protected, inherited] |
Decrease the reference counter.
tData& mds::img::CBlobLabeling< T >::getData | ( | int | i | ) |
Returns reference to user specific data.
int mds::img::CBlobLabeling< T >::getLabel | ( | int | i | ) |
Returns the label for a specified blob.
int mds::base::CObject::getReferencesCount | ( | ) | const [inherited] |
Returns the number of references.
int mds::img::CBlobLabeling< T >::getRoot | ( | int | i | ) | [protected] |
Finds root for a given blob.
int mds::img::CBlobLabeling< T >::getSize | ( | ) | const |
Returns the current number of blobs.
bool mds::img::CBlobLabeling< T >::isEquivalent | ( | int | i, |
int | j | ||
) | [protected] |
Returns true if two given blobs have been merged.
bool mds::base::CObject::isOnHeap | ( | ) | const [inherited] |
Returns true if the object is allocated on the heap.
bool mds::img::CBlobLabeling< T >::isRoot | ( | int | i | ) | const [protected] |
Returns true if a subscripted blob is a root (its label is equal to the given blob number.
mds::img::CBlobLabeling< T >::MDS_SHAREDPTR | ( | CBlobLabeling< T > | ) |
Smart pointer type.
void mds::img::CBlobLabeling< T >::merge | ( | int | i, |
int | j | ||
) |
Modifies the mapping so that the two given blobs share the same label.
int mds::img::CBlobLabeling< T >::newLabel | ( | ) |
Returns a new label.
int mds::img::CBlobLabeling< T >::newLabel | ( | const tData & | Data | ) |
Returns a new label.
static void* mds::base::CObject::operator new | ( | std::size_t | Size | ) | [static, inherited] |
Allocates a new object on the heap.
void mds::img::CBlobLabeling< T >::relabel | ( | int | StartingValue = 0 | ) |
Re-orders labels so that there will be no gaps in the numbering.
int mds::img::CBlobLabeling< T >::m_HighestLabel [protected] |
First available label.
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.
tLabels mds::img::CBlobLabeling< T >::m_Labels [protected] |