![]() |
Orfeo Toolbox
3.16
|
The base class for the representation of an labeled binary object in an image. More...
#include <itkLabelObject.h>
Inheritance diagram for itk::LabelObject< TLabel, VImageDimension >:
Collaboration diagram for itk::LabelObject< TLabel, VImageDimension >:Public Types | |
| typedef unsigned int | AttributeType |
| typedef SmartPointer< const Self > | ConstPointer |
| typedef WeakPointer< const Self > | ConstWeakPointer |
| typedef Index< VImageDimension > | IndexType |
| typedef Self | LabelObjectType |
| typedef TLabel | LabelType |
| typedef LineType::LengthType | LengthType |
| typedef std::deque< LineType > | LineContainerType |
| typedef LabelObjectLine < VImageDimension > | LineType |
| typedef SmartPointer< Self > | Pointer |
| typedef LabelObject | Self |
| typedef unsigned long | SizeValueType |
| typedef LightObject | Superclass |
Public Member Functions | |
| void | AddIndex (const IndexType &idx) |
| void | AddLine (const IndexType &idx, const LengthType &length) |
| void | AddLine (const LineType &line) |
| void | CopyAllFrom (const Self *src) |
| virtual void | CopyAttributesFrom (const Self *src) |
| virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
| virtual void | Delete () |
| bool | Empty () const |
| IndexType | GetIndex (SizeValueType offset) const |
| const LabelType & | GetLabel () const |
| const LineType & | GetLine (SizeValueType i) const |
| LineType & | GetLine (SizeValueType i) |
| const LineContainerType & | GetLineContainer () const |
| LineContainerType & | GetLineContainer () |
| virtual const char * | GetNameOfClass () const |
| SizeValueType | GetNumberOfLines () const |
| virtual int | GetReferenceCount () const |
| bool | HasIndex (const IndexType &idx) const |
| void | Optimize () |
| void | Print (std::ostream &os, Indent indent=0) const |
| virtual void | Register () const |
| void | SetLabel (const LabelType &label) |
| void | SetLineContainer (const LineContainerType &lineContainer) |
| virtual void | SetReferenceCount (int) |
| SizeValueType | Size () const |
| virtual void | UnRegister () const |
Static Public Member Functions | |
| static void | BreakOnError () |
| static AttributeType | GetAttributeFromName (const std::string &s) |
| static std::string | GetNameFromAttribute (const AttributeType &a) |
| static Pointer | New () |
Static Public Attributes | |
| static const unsigned int | ImageDimension = VImageDimension |
| static const AttributeType | LABEL = 0 |
Protected Types | |
| typedef int | InternalReferenceCountType |
Protected Member Functions | |
| LabelObject () | |
| virtual void | PrintHeader (std::ostream &os, Indent indent) const |
| void | PrintSelf (std::ostream &os, Indent indent) const |
| virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
Protected Attributes | |
| InternalReferenceCountType | m_ReferenceCount |
| SimpleFastMutexLock | m_ReferenceCountLock |
Private Member Functions | |
| LabelObject (const Self &) | |
| void | operator= (const Self &) |
Private Attributes | |
| LabelType | m_Label |
| LineContainerType | m_LineContainer |
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.
This implementation was taken from the Insight Journal paper: http://hdl.handle.net/1926/584 or http://www.insight-journal.org/browse/publication/176
Definition at line 55 of file itkLabelObject.h.
| typedef unsigned int itk::LabelObject< TLabel, VImageDimension >::AttributeType |
Definition at line 79 of file itkLabelObject.h.
| typedef SmartPointer<const Self> itk::LabelObject< TLabel, VImageDimension >::ConstPointer |
Definition at line 63 of file itkLabelObject.h.
| typedef WeakPointer<const Self> itk::LabelObject< TLabel, VImageDimension >::ConstWeakPointer |
Definition at line 64 of file itkLabelObject.h.
| typedef Index< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::IndexType |
Definition at line 74 of file itkLabelObject.h.
|
protectedinherited |
Define the type of the reference count according to the target. This allows the use of atomic operations
Definition at line 137 of file itkLightObject.h.
| typedef Self itk::LabelObject< TLabel, VImageDimension >::LabelObjectType |
Definition at line 61 of file itkLabelObject.h.
| typedef TLabel itk::LabelObject< TLabel, VImageDimension >::LabelType |
Definition at line 75 of file itkLabelObject.h.
| typedef LineType::LengthType itk::LabelObject< TLabel, VImageDimension >::LengthType |
Definition at line 77 of file itkLabelObject.h.
| typedef std::deque< LineType > itk::LabelObject< TLabel, VImageDimension >::LineContainerType |
Definition at line 78 of file itkLabelObject.h.
| typedef LabelObjectLine< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::LineType |
Definition at line 76 of file itkLabelObject.h.
| typedef SmartPointer<Self> itk::LabelObject< TLabel, VImageDimension >::Pointer |
Definition at line 62 of file itkLabelObject.h.
| typedef LabelObject itk::LabelObject< TLabel, VImageDimension >::Self |
Standard class typedefs
Definition at line 59 of file itkLabelObject.h.
| typedef unsigned long itk::LabelObject< TLabel, VImageDimension >::SizeValueType |
Definition at line 80 of file itkLabelObject.h.
| typedef LightObject itk::LabelObject< TLabel, VImageDimension >::Superclass |
Definition at line 60 of file itkLabelObject.h.
|
protected |
Definition at line 29 of file itkLabelObject.txx.
|
private |
| 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.
Definition at line 106 of file itkLabelObject.txx.
References itk::LabelObjectLine< VImageDimension >::GetLength(), itk::LabelObjectLine< VImageDimension >::IsNextIndex(), and itk::LabelObjectLine< VImageDimension >::SetLength().
| void itk::LabelObject< TLabel, VImageDimension >::AddLine | ( | const IndexType & | idx, |
| const LengthType & | length | ||
| ) |
Add a new line to the object, without any check.
Definition at line 128 of file itkLabelObject.txx.
| void itk::LabelObject< TLabel, VImageDimension >::AddLine | ( | const LineType & | line | ) |
Add a new line to the object, without any check.
Definition at line 140 of file itkLabelObject.txx.
|
staticinherited |
This method is called when itkExceptionMacro executes. It allows the debugger to break on error.
Definition at line 149 of file itkLightObject.cxx.
| void itk::LabelObject< TLabel, VImageDimension >::CopyAllFrom | ( | const Self * | src | ) |
Copy the lines, the label and the attributes from another node.
Definition at line 252 of file itkLabelObject.txx.
References NULL.
|
virtual |
Copy the attributes of another node to this one
Reimplemented in itk::ShapeLabelObject< TLabel, VImageDimension >, otb::AttributesMapLabelObject< TLabel, VImageDimension, TAttributesValue >, itk::StatisticsLabelObject< TLabel, VImageDimension >, itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, and otb::AttributesMapLabelObjectWithClassLabel< TLabel, VImageDimension, TAttributesValue, TClassLabel >.
Definition at line 242 of file itkLabelObject.txx.
References NULL.
|
virtual |
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 from itk::LightObject.
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
|
virtualinherited |
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.
Delete a 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.
Definition at line 88 of file itkLightObject.cxx.
| bool itk::LabelObject< TLabel, VImageDimension >::Empty | ( | ) | const |
Definition at line 206 of file itkLabelObject.txx.
|
static |
Definition at line 37 of file itkLabelObject.txx.
| LabelObject< TLabel, VImageDimension >::IndexType itk::LabelObject< TLabel, VImageDimension >::GetIndex | ( | SizeValueType | offset | ) | const |
Definition at line 213 of file itkLabelObject.txx.
References itk::Index< VIndexDimension >::GetIndex().
| const LabelObject< TLabel, VImageDimension >::LabelType & itk::LabelObject< TLabel, VImageDimension >::GetLabel | ( | ) | const |
Set/Get the label associated with the object.
Set/Get the label associated with that object.
Definition at line 66 of file itkLabelObject.txx.
| const LabelObject< TLabel, VImageDimension >::LineType & itk::LabelObject< TLabel, VImageDimension >::GetLine | ( | SizeValueType | i | ) | const |
Definition at line 178 of file itkLabelObject.txx.
| LabelObject< TLabel, VImageDimension >::LineType & itk::LabelObject< TLabel, VImageDimension >::GetLine | ( | SizeValueType | i | ) |
Definition at line 185 of file itkLabelObject.txx.
| const LabelObject< TLabel, VImageDimension >::LineContainerType & itk::LabelObject< TLabel, VImageDimension >::GetLineContainer | ( | ) | const |
Return the line container of this object
Definition at line 149 of file itkLabelObject.txx.
| LabelObject< TLabel, VImageDimension >::LineContainerType & itk::LabelObject< TLabel, VImageDimension >::GetLineContainer | ( | ) |
Definition at line 156 of file itkLabelObject.txx.
|
static |
Definition at line 50 of file itkLabelObject.txx.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::LightObject.
Reimplemented in otb::AttributesMapLabelObject< TLabel, VImageDimension, TAttributesValue >, itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, otb::AttributesMapLabelObjectWithClassLabel< TLabel, VImageDimension, TAttributesValue, TClassLabel >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
| LabelObject< TLabel, VImageDimension >::SizeValueType itk::LabelObject< TLabel, VImageDimension >::GetNumberOfLines | ( | ) | const |
Definition at line 170 of file itkLabelObject.txx.
|
inlinevirtualinherited |
Gets the reference count on this object.
Definition at line 105 of file itkLightObject.h.
| 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.
Definition at line 85 of file itkLabelObject.txx.
|
static |
Method for creation through the object factory.
|
private |
| void itk::LabelObject< TLabel, VImageDimension >::Optimize | ( | ) |
Reorder the lines, merge the touching lines and ensure that no pixel is covered by two lines
Definition at line 265 of file itkLabelObject.txx.
References itk::LabelObjectLine< VImageDimension >::GetIndex(), itk::Index< VIndexDimension >::GetIndex(), and itk::LabelObjectLine< VImageDimension >::GetLength().
|
inherited |
Cause the object to print itself out.
Avoid DLL boundary problems. This function will be common to all itk objects. It just calls the header/self/trailer virtual print methods, which can be overriden by subclasses (any itk object).
Definition at line 135 of file itkLightObject.cxx.
References itk::Indent::GetNextIndent().
Referenced by itk::operator<<().
|
protectedvirtualinherited |
Define a default print header for all objects.
Definition at line 320 of file itkLightObject.cxx.
|
protectedvirtual |
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.
Chaining method to print an object's instance variables, as well as its superclasses.
Reimplemented from itk::LightObject.
Reimplemented in itk::StatisticsLabelObject< TLabel, VImageDimension >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >.
Definition at line 325 of file itkLabelObject.txx.
|
protectedvirtualinherited |
Define a default print trailer for all objects.
Definition at line 331 of file itkLightObject.cxx.
|
virtualinherited |
Increase the reference count (mark as used by another object).
Reimplemented in itk::ExceptionObject::ReferenceCountedExceptionData, and itk::Object.
Definition at line 160 of file itkLightObject.cxx.
Referenced by itk::ExceptionObject::ReferenceCountedExceptionData::Register().
| void itk::LabelObject< TLabel, VImageDimension >::SetLabel | ( | const LabelType & | label | ) |
Definition at line 73 of file itkLabelObject.txx.
| void itk::LabelObject< TLabel, VImageDimension >::SetLineContainer | ( | const LineContainerType & | lineContainer | ) |
Definition at line 163 of file itkLabelObject.txx.
|
virtualinherited |
Sets the reference count on this object. This is a dangerous method, use it with care.
Sets the reference count (use with care)
Reimplemented in itk::Object.
Definition at line 244 of file itkLightObject.cxx.
| LabelObject< TLabel, VImageDimension >::SizeValueType itk::LabelObject< TLabel, VImageDimension >::Size | ( | void | ) | const |
Definition at line 192 of file itkLabelObject.txx.
|
virtualinherited |
Decrease the reference count (release by another object).
Reimplemented in itk::ExceptionObject::ReferenceCountedExceptionData, and itk::Object.
Definition at line 192 of file itkLightObject.cxx.
Referenced by itk::LightObject::New(), and itk::ExceptionObject::ReferenceCountedExceptionData::UnRegister().
|
static |
Definition at line 72 of file itkLabelObject.h.
|
static |
Definition at line 82 of file itkLabelObject.h.
|
private |
Definition at line 154 of file itkLabelObject.h.
|
private |
Definition at line 153 of file itkLabelObject.h.
|
mutableprotectedinherited |
Number of uses of this object by other objects.
Definition at line 141 of file itkLightObject.h.
|
mutableprotectedinherited |
Mutex lock to protect modification to the reference count
Definition at line 144 of file itkLightObject.h.