18 #ifndef itkLabelObject_h
19 #define itkLabelObject_h
63 template<
typename TLabel,
unsigned int VImageDimension >
81 itkStaticConstMacro(ImageDimension,
unsigned int, VImageDimension);
93 static AttributeType GetAttributeFromName(
const std::string & s);
95 static std::string GetNameFromAttribute(
const AttributeType & a);
108 bool HasIndex(
const IndexType & idx)
const;
121 bool RemoveIndex(
const IndexType & idx );
131 void AddLine(
const LineType & line);
163 template<
typename TSourceLabelObject >
164 void CopyLinesFrom(
const TSourceLabelObject *src);
167 template<
typename TSourceLabelObject >
168 void CopyAttributesFrom(
const TSourceLabelObject *src);
171 template<
typename TSourceLabelObject >
172 void CopyAllFrom(
const TSourceLabelObject *src);
194 m_Begin = lo->m_LineContainer.begin();
195 m_End = lo->m_LineContainer.end();
196 m_Iterator = m_Begin;
239 return !( *
this == iter );
244 m_Iterator = m_Begin;
249 return m_Iterator == m_End;
278 m_Begin = lo->m_LineContainer.begin();
279 m_End = lo->m_LineContainer.end();
308 if( m_Index[0] >= m_Iterator->GetIndex()[0] + (
OffsetValueType)m_Iterator->GetLength() )
331 return !( *
this == iter );
336 m_Iterator = m_Begin;
343 return m_Iterator == m_End;
353 while( m_Iterator != m_End && m_Iterator->GetLength() == 0 )
357 if( m_Iterator != m_End )
359 m_Index = m_Iterator->GetIndex();
371 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
383 #ifndef ITK_MANUAL_INSTANTIATION
384 #include "itkLabelObject.hxx"
Light weight base class for most itk classes.
bool operator==(const ConstLineIterator &iter) const
Represent the offset between two n-dimensional indexes in a n-dimensional image.
ConstLineIterator(const Self *lo)
Represent the size (bounds) of a n-dimensional image.
InternalIteratorType m_End
signed long OffsetValueType
ConstIndexIterator & operator++()
bool operator==(const ConstIndexIterator &iter) const
bool operator!=(const ConstIndexIterator &iter) const
std::deque< LineType > LineContainerType
InternalIteratorType m_Begin
std::deque< LineType > LineContainerType
Implements a weak reference to an object.
std::deque< LineType > LineContainerType
ConstLineIterator & operator++()
unsigned long SizeValueType
LabelObjectLine< VImageDimension > LineType
const IndexType & GetIndex() const
SmartPointer< const Self > ConstPointer
LineContainerType m_LineContainer
unsigned int AttributeType
Index< VImageDimension > IndexType
const LineType & GetLine() const
LineType::LengthType LengthType
Offset< VImageDimension > OffsetType
LineContainerType::const_iterator InternalIteratorType
ConstIndexIterator & operator=(const ConstIndexIterator &iter)
ConstIndexIterator(const Self *lo)
itk::SizeValueType SizeValueType
ConstLineIterator operator++(int)
ConstIndexIterator(const ConstIndexIterator &iter)
ConstIndexIterator operator++(int)
bool operator!=(const ConstLineIterator &iter) const
The base class for the representation of an labeled binary object in an image.
InternalIteratorType m_Iterator
WeakPointer< const Self > ConstWeakPointer
SmartPointer< Self > Pointer
ConstLineIterator(const ConstLineIterator &iter)
InternalIteratorType m_Iterator
LineContainerType::const_iterator InternalIteratorType
Control indentation during Print() invocation.
InternalIteratorType m_End
InternalIteratorType m_Begin
A forward iterator over the lines of a LabelObject.
ConstLineIterator & operator=(const ConstLineIterator &iter)