69 template<
typename TLabelObject >
73 ITK_DISALLOW_COPY_AND_ASSIGN(
LabelMap);
99 static constexpr
unsigned int ImageDimension = LabelObjectType::ImageDimension;
138 void Initialize()
override;
141 void Allocate(
bool initialize =
false)
override;
143 virtual void Graft(
const Self *imgData);
159 bool HasLabel(
const LabelType label)
const;
242 void RemoveLabel(
const LabelType & label);
267 itkGetConstMacro(BackgroundValue,
LabelType);
275 void PrintLabelObjects(std::ostream & os)
const;
279 this->PrintLabelObjects(std::cerr);
299 m_Begin = lm->m_LabelObjectContainer.begin();
300 m_End = lm->m_LabelObjectContainer.end();
301 m_Iterator = m_Begin;
321 return m_Iterator->second;
326 return m_Iterator->first;
349 return !( *
this == iter );
354 m_Iterator = m_Begin;
359 return m_Iterator == m_End;
381 m_Begin = lm->m_LabelObjectContainer.begin();
382 m_End = lm->m_LabelObjectContainer.end();
383 m_Iterator = m_Begin;
403 return m_Iterator->second;
408 return m_Iterator->first;
431 return !( *
this == iter );
436 m_Iterator = m_Begin;
441 return m_Iterator == m_End;
456 void PrintSelf(std::ostream & os,
Indent indent)
const override;
458 using Superclass::Graft;
475 bool iEmitModifiedEvent );
479 #ifndef ITK_MANUAL_INSTANTIATION
480 #include "itkLabelMap.hxx"
InternalIteratorType m_Iterator
std::map< LabelType, LabelObjectPointerType > LabelObjectContainerType
ConstIterator(const Self *lm)
typename std::map< LabelType, LabelObjectPointerType >::const_iterator InternalIteratorType
std::vector< LabelObjectPointerType > LabelObjectVectorType
InternalIteratorType m_Iterator
Iterator(const Iterator &iter)
typename Superclass::DirectionType DirectionType
unsigned long SizeValueType
typename Superclass::SizeValueType SizeValueType
LabelObjectType * GetLabelObject()
typename Superclass::SpacingType SpacingType
typename Superclass::OffsetValueType OffsetValueType
bool operator==(const Iterator &iter) const
typename std::map< LabelType, LabelObjectPointerType >::iterator InternalIteratorType
typename Superclass::IndexType IndexType
typename LabelObjectType::Pointer LabelObjectPointerType
Implements a weak reference to an object.
LabelObjectContainerType m_LabelObjectContainer
bool operator!=(const ConstIterator &iter) const
const LabelType & GetLabel() const
InternalIteratorType m_End
ConstIterator & operator=(const ConstIterator &iter)
std::vector< LabelType > LabelVectorType
void PrintLabelObjects() const
LabelType m_BackgroundValue
bool operator!=(const Iterator &iter) const
typename Superclass::PointType PointType
ImageBaseType::SizeType SizeType
ImageBaseType::DirectionType DirectionType
ImageBaseType::IndexType IndexType
const LabelType & GetLabel() const
const LabelObjectType * GetLabelObject() const
Iterator & operator=(const Iterator &iter)
ConstIterator operator++(int)
typename LabelObjectContainerType::const_iterator LabelObjectContainerConstIterator
A forward iterator over the LabelObjects of a LabelMap.
TLabelObject LabelObjectType
InternalIteratorType m_Begin
typename LabelObjectContainerType::iterator LabelObjectContainerIterator
typename Superclass::RegionType RegionType
typename Superclass::SizeType SizeType
Base class for templated image classes.
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
InternalIteratorType m_Begin
Templated n-dimensional image to store labeled objects.
ConstIterator & operator++()
typename LabelObjectType::LabelType LabelType
ImageBaseType::RegionType RegionType
InternalIteratorType m_End
typename Superclass::OffsetType OffsetType
signed long OffsetValueType
A forward iterator over the LabelObjects of a LabelMap.
Base class for all data objects in ITK.
bool operator==(const ConstIterator &iter) const
ConstIterator(const ConstIterator &iter)