ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkLabelObject.h>
Classes | |
class | ConstIndexIterator |
class | ConstLineIterator |
A forward iterator over the lines of a LabelObject. More... | |
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 LabelObjectLine < VImageDimension > | LineType |
typedef Offset< VImageDimension > | OffsetType |
typedef SmartPointer< Self > | Pointer |
typedef LabelObject | Self |
typedef itk::SizeValueType | 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 | Clear () |
void | CopyAllFrom (const Self *src) |
virtual void | CopyAttributesFrom (const Self *src) |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
bool | Empty () const |
IndexType | GetIndex (SizeValueType i) const |
const LabelType & | GetLabel () const |
const LineType & | GetLine (SizeValueType i) const |
LineType & | GetLine (SizeValueType i) |
virtual const char * | GetNameOfClass () const |
SizeValueType | GetNumberOfLines () const |
bool | HasIndex (const IndexType &idx) const |
void | Optimize () |
bool | RemoveIndex (const IndexType &idx) |
void | SetLabel (const LabelType &label) |
void | Shift (OffsetType offset) |
SizeValueType | Size () const |
Static Public Member Functions | |
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 Member Functions | |
LabelObject () | |
void | PrintSelf (std::ostream &os, Indent indent) const |
Private Types | |
typedef std::deque< LineType > | LineContainerType |
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.
The pixels locations belonging to the LabelObject can be obtained using:
for(unsigned int pixelId = 0; pixelId < labelObject->Size(); pixelId++) { std::cout << labelObject->GetIndex(pixelId); }
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 64 of file itkLabelObject.h.
typedef unsigned int itk::LabelObject< TLabel, VImageDimension >::AttributeType |
Reimplemented in itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::ShapeLabelObject< TLabel, VImageDimension >.
Definition at line 88 of file itkLabelObject.h.
typedef SmartPointer< const Self > itk::LabelObject< TLabel, VImageDimension >::ConstPointer |
Reimplemented from itk::LightObject.
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 72 of file itkLabelObject.h.
typedef WeakPointer< const Self > itk::LabelObject< TLabel, VImageDimension >::ConstWeakPointer |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 73 of file itkLabelObject.h.
typedef Index< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::IndexType |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 83 of file itkLabelObject.h.
typedef Self itk::LabelObject< TLabel, VImageDimension >::LabelObjectType |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 70 of file itkLabelObject.h.
typedef TLabel itk::LabelObject< TLabel, VImageDimension >::LabelType |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::ShapeLabelObject< TLabel, VImageDimension >.
Definition at line 85 of file itkLabelObject.h.
typedef LineType::LengthType itk::LabelObject< TLabel, VImageDimension >::LengthType |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::ShapeLabelObject< TLabel, VImageDimension >.
Definition at line 87 of file itkLabelObject.h.
typedef std::deque< LineType > itk::LabelObject< TLabel, VImageDimension >::LineContainerType [private] |
Definition at line 371 of file itkLabelObject.h.
typedef LabelObjectLine< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::LineType |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::ShapeLabelObject< TLabel, VImageDimension >.
Definition at line 86 of file itkLabelObject.h.
typedef Offset< VImageDimension > itk::LabelObject< TLabel, VImageDimension >::OffsetType |
Definition at line 84 of file itkLabelObject.h.
typedef SmartPointer< Self > itk::LabelObject< TLabel, VImageDimension >::Pointer |
Reimplemented from itk::LightObject.
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 71 of file itkLabelObject.h.
typedef LabelObject itk::LabelObject< TLabel, VImageDimension >::Self |
Standard class typedefs
Reimplemented from itk::LightObject.
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 68 of file itkLabelObject.h.
typedef itk::SizeValueType itk::LabelObject< TLabel, VImageDimension >::SizeValueType |
Definition at line 89 of file itkLabelObject.h.
typedef LightObject itk::LabelObject< TLabel, VImageDimension >::Superclass |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 69 of file itkLabelObject.h.
itk::LabelObject< TLabel, VImageDimension >::LabelObject | ( | ) | [protected] |
itk::LabelObject< TLabel, VImageDimension >::LabelObject | ( | const Self & | ) | [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.
void itk::LabelObject< TLabel, VImageDimension >::AddLine | ( | const IndexType & | idx, |
const LengthType & | length | ||
) |
Add a new line to the object, without any check.
void itk::LabelObject< TLabel, VImageDimension >::AddLine | ( | const LineType & | line | ) |
Add a new line to the object, without any check.
void itk::LabelObject< TLabel, VImageDimension >::Clear | ( | ) |
void itk::LabelObject< TLabel, VImageDimension >::CopyAllFrom | ( | const Self * | src | ) |
Copy the lines, the label and the attributes from another node.
virtual void itk::LabelObject< TLabel, VImageDimension >::CopyAttributesFrom | ( | const Self * | src | ) | [virtual] |
Copy the attributes of another node to this one
Reimplemented in itk::ShapeLabelObject< TLabel, VImageDimension >, itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >.
virtual::itk::LightObject::Pointer itk::LabelObject< TLabel, VImageDimension >::CreateAnother | ( | void | ) | const [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 >.
bool itk::LabelObject< TLabel, VImageDimension >::Empty | ( | ) | const |
Returns true if there no line in the container (and thus no pixel in the object.
static AttributeType itk::LabelObject< TLabel, VImageDimension >::GetAttributeFromName | ( | const std::string & | s | ) | [static] |
IndexType itk::LabelObject< TLabel, VImageDimension >::GetIndex | ( | SizeValueType | i | ) | const |
Get the index of the ith pixel associated with the object. Valid indices are from 0 to LabelObject->GetSize() - 1.
const LabelType& itk::LabelObject< TLabel, VImageDimension >::GetLabel | ( | ) | const |
Set/Get the label associated with the object.
const LineType& itk::LabelObject< TLabel, VImageDimension >::GetLine | ( | SizeValueType | i | ) | const |
LineType& itk::LabelObject< TLabel, VImageDimension >::GetLine | ( | SizeValueType | i | ) |
static std::string itk::LabelObject< TLabel, VImageDimension >::GetNameFromAttribute | ( | const AttributeType & | a | ) | [static] |
Reimplemented in itk::ShapeLabelObject< TLabel, VImageDimension >.
virtual const char* itk::LabelObject< TLabel, VImageDimension >::GetNameOfClass | ( | ) | const [virtual] |
Run-time type information (and related methods).
Reimplemented from itk::LightObject.
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
SizeValueType itk::LabelObject< TLabel, VImageDimension >::GetNumberOfLines | ( | ) | const |
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.
static Pointer itk::LabelObject< TLabel, VImageDimension >::New | ( | ) | [static] |
Method for creation through the object factory.
Reimplemented from itk::LightObject.
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
void itk::LabelObject< TLabel, VImageDimension >::operator= | ( | const Self & | ) | [private] |
Mutex lock to protect modification to the reference count
Reimplemented from itk::LightObject.
Reimplemented in itk::ShapeLabelObject< TLabel, VImageDimension >, itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >.
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::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.
Reimplemented in itk::ShapeLabelObject< TLabel, VImageDimension >, itk::StatisticsLabelObject< TLabel, VImageDimension >, and itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >.
bool itk::LabelObject< TLabel, VImageDimension >::RemoveIndex | ( | const IndexType & | idx | ) |
Remove an index to the object. Depending on the configuration, it can either reduce the size of the corresponding line, add one more line, remove the line from the line container.
void itk::LabelObject< TLabel, VImageDimension >::SetLabel | ( | const LabelType & | label | ) |
void itk::LabelObject< TLabel, VImageDimension >::Shift | ( | OffsetType | offset | ) |
Shift the object position
SizeValueType itk::LabelObject< TLabel, VImageDimension >::Size | ( | ) | const |
Returns the number of pixels contained in the object.
const unsigned int itk::LabelObject< TLabel, VImageDimension >::ImageDimension = VImageDimension [static] |
Reimplemented in itk::AttributeLabelObject< TLabel, VImageDimension, TAttributeValue >, itk::ShapeLabelObject< TLabel, VImageDimension >, and itk::StatisticsLabelObject< TLabel, VImageDimension >.
Definition at line 81 of file itkLabelObject.h.
const AttributeType itk::LabelObject< TLabel, VImageDimension >::LABEL = 0 [static] |
Definition at line 91 of file itkLabelObject.h.
LabelType itk::LabelObject< TLabel, VImageDimension >::m_Label [private] |
Definition at line 374 of file itkLabelObject.h.
LineContainerType itk::LabelObject< TLabel, VImageDimension >::m_LineContainer [private] |
Definition at line 373 of file itkLabelObject.h.