21 #ifndef otbAttributesMapLabelObjectWithClassLabel_h
22 #define otbAttributesMapLabelObjectWithClassLabel_h
53 template <
class TLabel,
unsigned int VImageDimension,
class TAttributesValue,
class TClassLabel>
71 itkStaticConstMacro(ImageDimension,
unsigned int, VImageDimension);
80 m_HasClassLabel =
true;
89 itkExceptionMacro(<<
"LabelObject has no class label!");
98 return m_HasClassLabel;
104 m_ClassLabel = itk::NumericTraits<ClassLabelType>::Zero;
105 m_HasClassLabel =
false;
110 Superclass::CopyAttributesFrom(lo);
113 const Self* src =
dynamic_cast<const Self*
>(lo);
119 m_ClassLabel = src->m_ClassLabel;
120 m_HasClassLabel = src->m_HasClassLabel;
135 void PrintSelf(std::ostream& os, itk::Indent indent)
const override
137 Superclass::PrintSelf(os, indent);
140 os << indent <<
"Class Label: " << m_ClassLabel << std::endl;
144 os << indent <<
"No class label available." << std::endl;
An AttributesMapLabelObject with an optional class label.
itk::SmartPointer< const Self > ConstPointer
AttributesMapLabelObjectWithClassLabel()
bool HasClassLabel() const
void SetClassLabel(const ClassLabelType &label)
itk::LabelObject< TLabel, VImageDimension > LabelObjectType
itk::WeakPointer< const Self > ConstWeakPointer
TClassLabel ClassLabelType
void operator=(const Self &)=delete
void PrintSelf(std::ostream &os, itk::Indent indent) const override
AttributesMapLabelObjectWithClassLabel Self
~AttributesMapLabelObjectWithClassLabel() override
AttributesMapLabelObjectWithClassLabel(const Self &)=delete
itk::SmartPointer< Self > Pointer
const ClassLabelType & GetClassLabel() const
AttributesMapLabelObject< TLabel, VImageDimension, TAttributesValue > Superclass
ClassLabelType m_ClassLabel
void CopyAttributesFrom(const LabelObjectType *lo) override
A LabelObject with a generic attributes map.
Superclass::LabelObjectType LabelObjectType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.