69template <
typename TLabelObject>
73 ITK_DISALLOW_COPY_AND_MOVE(
LabelMap);
100 static constexpr unsigned int ImageDimension = LabelObjectType::ImageDimension;
114 using typename Superclass::OffsetType;
128 using typename Superclass::SpacingType;
275 return static_cast<SizeValueType>(m_LabelObjectContainer.size());
307 this->PrintLabelObjects(std::cerr);
328 m_Begin = lm->m_LabelObjectContainer.begin();
329 m_End = lm->m_LabelObjectContainer.end();
330 m_Iterator = m_Begin;
336 return m_Iterator->second;
342 return m_Iterator->first;
371 m_Iterator = m_Begin;
377 return m_Iterator == m_End;
399 m_Begin = lm->m_LabelObjectContainer.begin();
400 m_End = lm->m_LabelObjectContainer.end();
401 m_Iterator = m_Begin;
407 return m_Iterator->second;
413 return m_Iterator->first;
442 m_Iterator = m_Begin;
448 return m_Iterator == m_End;
467 using Superclass::Graft;
486#ifndef ITK_MANUAL_INSTANTIATION
487# include "itkLabelMap.hxx"
Base class for all data objects in ITK.
Base class for templated image classes.
typename SizeType::SizeValueType SizeValueType
Control indentation during Print() invocation.
A forward iterator over the LabelObjects of a LabelMap.
ConstIterator(const Self *lm)
typename std::map< LabelType, LabelObjectPointerType >::const_iterator InternalIteratorType
const LabelType & GetLabel() const
const LabelObjectType * GetLabelObject() const
ConstIterator & operator++()
InternalIteratorType m_Iterator
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ConstIterator)
InternalIteratorType m_Begin
InternalIteratorType m_End
bool operator==(const ConstIterator &iter) const
ConstIterator operator++(int)
A forward iterator over the LabelObjects of a LabelMap.
const LabelType & GetLabel() const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Iterator)
bool operator==(const Iterator &iter) const
InternalIteratorType m_End
InternalIteratorType m_Begin
typename std::map< LabelType, LabelObjectPointerType >::iterator InternalIteratorType
InternalIteratorType m_Iterator
LabelObjectType * GetLabelObject()
Templated n-dimensional image to store labeled objects.
void SetPixel(const IndexType &idx, const LabelType &iLabel)
Set the pixel value at a given index in the image.
LabelObjectType * GetLabelObject(const LabelType &label)
void Graft(const DataObject *data) override
void RemoveLabel(const LabelType &label)
void RemoveLabelObject(LabelObjectType *labelObject)
TLabelObject LabelObjectType
void PrintLabelObjects(std::ostream &os) const
typename LabelObjectType::Pointer LabelObjectPointerType
typename LabelObjectType::LabelType LabelType
LabelObjectType * GetNthLabelObject(const SizeValueType &pos)
LabelVectorType GetLabels() const
void RemovePixel(const IndexType &idx, const LabelType &label)
void Initialize() override
LabelObjectVectorType GetLabelObjects() const
const LabelType & GetPixel(const IndexType &idx) const
void AddPixel(const LabelObjectContainerIterator &it, const IndexType &idx, const LabelType &label)
std::map< LabelType, LabelObjectPointerType > LabelObjectContainerType
std::vector< LabelObjectPointerType > LabelObjectVectorType
Self::SizeValueType GetNumberOfLabelObjects() const
virtual void Graft(const Self *imgData)
typename LabelObjectContainerType::iterator LabelObjectContainerIterator
void AddLabelObject(LabelObjectType *labelObject)
void AddPixel(const IndexType &idx, const LabelType &label)
void Allocate(bool initialize=false) override
typename LabelObjectContainerType::const_iterator LabelObjectContainerConstIterator
void PushLabelObject(LabelObjectType *labelObject)
const LabelObjectType * GetNthLabelObject(const SizeValueType &pos) const
bool HasLabel(const LabelType label) const
void PrintLabelObjects() const
void PrintSelf(std::ostream &os, Indent indent) const override
std::vector< LabelType > LabelVectorType
~LabelMap() override=default
LabelObjectType * GetLabelObject(const IndexType &idx) const
const LabelObjectType * GetLabelObject(const LabelType &label) const
void SetLine(const IndexType &idx, const LengthType &length, const LabelType &label)
void RemovePixel(const LabelObjectContainerIterator &it, const IndexType &idx, bool iEmitModifiedEvent)
Base class for most ITK classes.
Implements a weak reference to an object.
SmartPointer< Self > Pointer
ImageBaseType::DirectionType DirectionType
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType