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

Method SetAlgorithmTypeStr

Modules/Multilabel/src/mitkLabel.cpp:447–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447void mitk::Label::SetAlgorithmTypeStr(const std::string& algoType)
448{
449 if (algoType.empty())
450 {
451 this->RemoveProperty("algorithm_type");
452 }
453 else if (algoType != "MANUAL" && algoType != "SEMIAUTOMATIC" && algoType != "AUTOMATIC")
454 {
455 mitkThrow() << "Invalid call of Label::SetAlgorithmTypeStr. Passed string is an unsupported type. Invalid string: "<<algoType;
456 }
457 else
458 {
459 mitk::StringProperty* property = dynamic_cast<mitk::StringProperty*>(this->GetProperty("algorithm_type"));
460 if (property != nullptr)
461 // Update Property
462 property->SetValue(algoType);
463 else
464 // Create new Property
465 SetStringProperty("algorithm_type", algoType.c_str());
466 }
467}
468
469mitk::Label::AlgorithmType mitk::Label::GetAlgorithmType() const
470{

Callers 3

SetAlgorithmTypeMethod · 0.95
SetLabelPropertiesMethod · 0.80

Calls 4

emptyMethod · 0.45
RemovePropertyMethod · 0.45
GetPropertyMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected