MCPcopy Create free account
hub / github.com/MITK/MITK / SetLabelName

Function SetLabelName

Modules/Segmentation/cmdapps/ContoursToImage.cpp:81–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81bool SetLabelName(const mitk::IPropertyProvider* propertyProvider, mitk::Label* label)
82{
83 if (propertyProvider != nullptr)
84 {
85 if (auto property = propertyProvider->GetConstProperty("name"); property.IsNotNull())
86 {
87 if (auto nameProperty = dynamic_cast<const mitk::StringProperty*>(property.GetPointer()); nameProperty != nullptr)
88 {
89 if (auto name = nameProperty->GetValueAsString(); !name.empty())
90 {
91 label->SetName(name);
92 return true;
93 }
94 }
95 }
96 }
97
98 return false;
99}
100
101bool SetLabelColor(const mitk::IPropertyProvider* propertyProvider, mitk::Label* label)
102{

Callers 1

mainFunction · 0.85

Calls 6

IsNotNullMethod · 0.80
GetPointerMethod · 0.80
GetConstPropertyMethod · 0.45
GetValueAsStringMethod · 0.45
emptyMethod · 0.45
SetNameMethod · 0.45

Tested by

no test coverage detected