Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::LabelObject< TLabel, VImageDimension > Class Template Reference
[Data Representation Objects]

#include <itkLabelObject.h>

Inheritance diagram for itk::LabelObject< TLabel, VImageDimension >:

Inheritance graph
[legend]
Collaboration diagram for itk::LabelObject< TLabel, VImageDimension >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class TLabel, unsigned int VImageDimension>
class itk::LabelObject< TLabel, VImageDimension >

The base class for the representation of an labeled binary object in an image.

LabelObject is the base class to represent a labeled object in an image. It should be used associated with the LabelMap.

LabelObject store mainly 2 things: the label of the object, and a set of lines which are part of the object. No attribute is available in that class, so this class can be used as a base class to implement a label object with attribute, or when no attribute is needed (see the reconstruction filters for an example. If a simple attribute is needed, AttributeLabelObject can be used directly.

All the subclasses of LabelObject have to reinplement the CopyAttributesFrom() method.

Author:
Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
This implementation was taken from the Insight Journal paper: http://hdl.handle.net/1926/584 or http://www.insight-journal.org/browse/publication/176

See also:
LabelMapFilter, AttributeLabelObject

Definition at line 55 of file itkLabelObject.h.


Public Types

enum  { LABEL = 0 }
typedef unsigned int AttributeType
typedef SmartPointer< const SelfConstPointer
typedef WeakPointer< const SelfConstWeakPointer
typedef Index< VImageDimension > IndexType
typedef Self LabelObjectType
typedef TLabel LabelType
typedef LineType::LengthType LengthType
typedef std::deque< LineTypeLineContainerType
typedef LabelObjectLine
< VImageDimension > 
LineType
typedef SmartPointer< SelfPointer
typedef LabelObject Self
typedef LightObject Superclass

Public Member Functions

void AddIndex (const IndexType &idx)
void AddLine (const LineType &line)
void AddLine (const IndexType &idx, const LengthType &length)
void CopyAllFrom (const Self *src)
virtual void CopyAttributesFrom (const Self *src)
virtual Pointer CreateAnother () const
virtual void Delete ()
IndexType GetIndex (int offset) const
LineTypeGetLine (int i)
const LineTypeGetLine (int i) const
LineContainerTypeGetLineContainer ()
const LineContainerTypeGetLineContainer () const
virtual const char * GetNameOfClass () const
int GetNumberOfLines () const
virtual int GetReferenceCount () const
bool HasIndex (const IndexType &idx) const
 itkStaticConstMacro (ImageDimension, unsigned int, VImageDimension)
void Optimize ()
void Print (std::ostream &os, Indent indent=0) const
virtual void Register () const
void SetLineContainer (const LineContainerType &lineContainer)
virtual void SetReferenceCount (int)
int Size () const
virtual void UnRegister () const
const LabelTypeGetLabel () const
void SetLabel (const LabelType &label)

Static Public Member Functions

static void BreakOnError ()
static AttributeType GetAttributeFromName (const std::string &s)
static std::string GetNameFromAttribute (const AttributeType &a)
static Pointer New ()

Protected Types

typedef int InternalReferenceCountType

Protected Member Functions

 LabelObject ()
void PrintSelf (std::ostream &os, Indent indent) const
virtual void PrintHeader (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const

Protected Attributes

InternalReferenceCountType m_ReferenceCount
SimpleFastMutexLock m_ReferenceCountLock

Member Typedef Documentation

template<class TLabel, unsigned int VImageDimension>
typedef unsigned int itk::LabelObject< TLabel, VImageDimension >::AttributeType

Definition at line 79 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef SmartPointer<const Self> itk::LabelObject< TLabel, VImageDimension >::ConstPointer

Reimplemented from itk::LightObject.

Definition at line 63 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef WeakPointer<const Self> itk::LabelObject< TLabel, VImageDimension >::ConstWeakPointer

Definition at line 64 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef Index< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::IndexType

Definition at line 74 of file itkLabelObject.h.

typedef int itk::LightObject::InternalReferenceCountType [protected, inherited]

Define the type of the reference count according to the target. This allows the use of atomic operations

Definition at line 139 of file itkLightObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef Self itk::LabelObject< TLabel, VImageDimension >::LabelObjectType

Definition at line 61 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef TLabel itk::LabelObject< TLabel, VImageDimension >::LabelType

Definition at line 75 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef LineType::LengthType itk::LabelObject< TLabel, VImageDimension >::LengthType

Definition at line 77 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef std::deque< LineType > itk::LabelObject< TLabel, VImageDimension >::LineContainerType

Definition at line 78 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef LabelObjectLine< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::LineType

Definition at line 76 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef SmartPointer<Self> itk::LabelObject< TLabel, VImageDimension >::Pointer

Reimplemented from itk::LightObject.

Definition at line 62 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef LabelObject itk::LabelObject< TLabel, VImageDimension >::Self

Standard class typedefs

Reimplemented from itk::LightObject.

Definition at line 59 of file itkLabelObject.h.

template<class TLabel, unsigned int VImageDimension>
typedef LightObject itk::LabelObject< TLabel, VImageDimension >::Superclass

Definition at line 60 of file itkLabelObject.h.


Member Enumeration Documentation

template<class TLabel, unsigned int VImageDimension>
anonymous enum

Enumerator:
LABEL 

Definition at line 81 of file itkLabelObject.h.


Constructor & Destructor Documentation

template<class TLabel, unsigned int VImageDimension>
itk::LabelObject< TLabel, VImageDimension >::LabelObject (  )  [protected]


Member Function Documentation

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::AddIndex ( const IndexType idx  ) 

Add an index to the object. If the index is already in the object, the index can be found several time in the object.

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::AddLine ( const LineType line  ) 

Add a new line to the object, without any check.

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::AddLine ( const IndexType idx,
const LengthType length 
)

Add a new line to the object, without any check.

static void itk::LightObject::BreakOnError (  )  [static, inherited]

This method is called when itkExceptionMacro executes. It allows the debugger to break on error.

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::CopyAllFrom ( const Self src  ) 

Copy the lines, the label and the attributes from another node.

template<class TLabel, unsigned int VImageDimension>
virtual void itk::LabelObject< TLabel, VImageDimension >::CopyAttributesFrom ( const Self src  )  [virtual]

Copy the attributes of another node to this one

virtual Pointer itk::LightObject::CreateAnother (  )  const [virtual, inherited]

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented in itk::Object.

virtual void itk::LightObject::Delete (  )  [virtual, inherited]

Delete an itk object. This method should always be used to delete an object when the new operator was used to create it. Using the C delete method will not work with reference counting.

template<class TLabel, unsigned int VImageDimension>
static AttributeType itk::LabelObject< TLabel, VImageDimension >::GetAttributeFromName ( const std::string &  s  )  [static]

template<class TLabel, unsigned int VImageDimension>
IndexType itk::LabelObject< TLabel, VImageDimension >::GetIndex ( int  offset  )  const

template<class TLabel, unsigned int VImageDimension>
const LabelType& itk::LabelObject< TLabel, VImageDimension >::GetLabel (  )  const

Set/Get the label associated with the object.

template<class TLabel, unsigned int VImageDimension>
LineType& itk::LabelObject< TLabel, VImageDimension >::GetLine ( int  i  ) 

template<class TLabel, unsigned int VImageDimension>
const LineType& itk::LabelObject< TLabel, VImageDimension >::GetLine ( int  i  )  const

template<class TLabel, unsigned int VImageDimension>
LineContainerType& itk::LabelObject< TLabel, VImageDimension >::GetLineContainer (  ) 

template<class TLabel, unsigned int VImageDimension>
const LineContainerType& itk::LabelObject< TLabel, VImageDimension >::GetLineContainer (  )  const

Return the line container of this object

template<class TLabel, unsigned int VImageDimension>
static std::string itk::LabelObject< TLabel, VImageDimension >::GetNameFromAttribute ( const AttributeType a  )  [static]

template<class TLabel, unsigned int VImageDimension>
virtual const char* itk::LabelObject< TLabel, VImageDimension >::GetNameOfClass (  )  const [virtual]

Run-time type information (and related methods).

Reimplemented from itk::LightObject.

template<class TLabel, unsigned int VImageDimension>
int itk::LabelObject< TLabel, VImageDimension >::GetNumberOfLines (  )  const

virtual int itk::LightObject::GetReferenceCount (  )  const [inline, virtual, inherited]

Gets the reference count on this object.

Definition at line 106 of file itkLightObject.h.

template<class TLabel, unsigned int VImageDimension>
bool itk::LabelObject< TLabel, VImageDimension >::HasIndex ( const IndexType idx  )  const

Return true if the object contain the given index and false otherwise. Worst case complexity is O(L) where L is the number of lines in the object.

template<class TLabel, unsigned int VImageDimension>
itk::LabelObject< TLabel, VImageDimension >::itkStaticConstMacro ( ImageDimension  ,
unsigned  int,
VImageDimension   
)

template<class TLabel, unsigned int VImageDimension>
static Pointer itk::LabelObject< TLabel, VImageDimension >::New (  )  [static]

Method for creation through the object factory.

Reimplemented from itk::LightObject.

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::Optimize (  ) 

Reorder the lines, merge the touching lines and ensure that no pixel is covered by two lines

void itk::LightObject::Print ( std::ostream &  os,
Indent  indent = 0 
) const [inherited]

virtual void itk::LightObject::PrintHeader ( std::ostream &  os,
Indent  indent 
) const [protected, virtual, inherited]

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::LightObject.

virtual void itk::LightObject::PrintTrailer ( std::ostream &  os,
Indent  indent 
) const [protected, virtual, inherited]

virtual void itk::LightObject::Register (  )  const [virtual, inherited]

Increase the reference count (mark as used by another object).

Reimplemented in itk::Object.

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::SetLabel ( const LabelType label  ) 

Set/Get the label associated with the object.

template<class TLabel, unsigned int VImageDimension>
void itk::LabelObject< TLabel, VImageDimension >::SetLineContainer ( const LineContainerType lineContainer  ) 

virtual void itk::LightObject::SetReferenceCount ( int   )  [virtual, inherited]

Sets the reference count on this object. This is a dangerous method, use it with care.

Reimplemented in itk::Object.

template<class TLabel, unsigned int VImageDimension>
int itk::LabelObject< TLabel, VImageDimension >::Size (  )  const

virtual void itk::LightObject::UnRegister (  )  const [virtual, inherited]

Decrease the reference count (release by another object).

Reimplemented in itk::Object.


Member Data Documentation

Number of uses of this object by other objects.

Definition at line 144 of file itkLightObject.h.

Mutex lock to protect modification to the reference count

Definition at line 147 of file itkLightObject.h.


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

Generated at Thu May 28 15:28:41 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000