| 445 | } |
| 446 | |
| 447 | void 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 | |
| 469 | mitk::Label::AlgorithmType mitk::Label::GetAlgorithmType() const |
| 470 | { |
no test coverage detected