15 #include "itkProcessObject.h" 17 #include <itkCommand.h> 68 auto it =
map->begin();
69 auto end =
map->end();
71 for (; it != end; ++it)
73 itk::SimpleMemberCommand<Label>::Pointer command = itk::SimpleMemberCommand<Label>::New();
75 it->second->AddObserver(itk::ModifiedEvent(), command);
85 itk::SimpleMemberCommand<Label>::Pointer command = itk::SimpleMemberCommand<Label>::New();
87 property->AddObserver(itk::ModifiedEvent(), command);
89 Superclass::SetProperty(propertyKey, property, contextName, fallBackOnDefaultContext);
95 if (property !=
nullptr)
113 if (property !=
nullptr)
131 if (property !=
nullptr)
161 if (property !=
nullptr)
174 pixelValue =
property->GetValue();
181 if (property !=
nullptr)
206 if (colorProp !=
nullptr)
217 if (property !=
nullptr)
234 if (property !=
nullptr)
248 itk::LightObject::Pointer mitk::Label::InternalClone()
const 250 itk::LightObject::Pointer result(
new Self(*
this));
251 result->UnRegister();
262 MITK_INFO(verbose) <<
"--- Label Equal ---";
264 bool returnValue =
true;
272 returnValue = lhsmap->size() == rhsmap->size();
276 MITK_INFO(verbose) <<
"Labels in label container are not equal.";
280 auto lhsmapIt = lhsmap->begin();
281 auto lhsmapItEnd = lhsmap->end();
283 for (; lhsmapIt != lhsmapItEnd; ++lhsmapIt)
285 if (rhsmap->find(lhsmapIt->first) == rhsmap->end())
294 MITK_INFO(verbose) <<
"Labels in label container are not equal.";
bool GetFloatProperty(const char *propertyKey, float &floatValue) const
Convenience method to access the value of a FloatProperty.
mitk::Point3D GetCenterOfMassCoordinates() const
static void SetDICOMSegmentProperties(Label *label)
void SetBoolProperty(const char *propertyKey, bool boolValue)
Convenience method to set the value of a BoolProperty.
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
Add new or change existent property.
void SetColor(const mitk::Color &color)
void SetLocked(bool locked)
void SetLayer(unsigned int layer)
void SetValue(PixelType pixelValue)
mitk::Point3D GetCenterOfMassIndex() const
A data structure describing a label.
Key-value list holding instances of BaseProperty.
void SetOpacity(float opacity)
virtual T GetValue() const
The ColorProperty class RGB color property.
void SetColor(const mitk::Color &)
Abstract base class for properties.
std::map< std::string, BaseProperty::Pointer > PropertyMap
bool GetStringProperty(const char *propertyKey, std::string &stringValue) const
Convenience method to access the value of a StringProperty.
void SetVisible(bool visible)
static const PixelType MAX_LABEL_VALUE
The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535...
const mitk::Color & GetColor() const
const mitk::Color & GetColor() const
void SetCenterOfMassCoordinates(const mitk::Point3D ¢er)
PixelType GetValue() const
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
void SetCenterOfMassIndex(const mitk::Point3D ¢er)
unsigned int GetLayer() const
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
mitk::BaseProperty * GetProperty(const std::string &propertyKey) const
Get a property by its name.
void SetStringProperty(const char *propertyKey, const char *stringValue)
Convenience method to set the value of a StringProperty.
void SetFloatProperty(const char *propertyKey, float floatValue)
Convenience method to set the value of a FloatProperty.
bool GetBoolProperty(const char *propertyKey, bool &boolValue) const
Convenience method to access the value of a BoolProperty.
virtual void SetValue(T _arg)
void SetName(const std::string &name)
const PropertyMap * GetMap() const
std::string GetName() const
void PrintSelf(std::ostream &os, itk::Indent indent) const override