| 973 | } |
| 974 | |
| 975 | mitk::Label* mitk::MultiLabelSegmentation::AddLabelWithContent(Label* label, const Image* labelContent, GroupIndexType groupID, LabelValueType contentLabelValue, bool addAsClone, bool correctLabelValue) |
| 976 | { |
| 977 | if (nullptr == labelContent) mitkThrow() << "Invalid use of AddLabel. labelContent is not valid."; |
| 978 | if (!Equal(*(this->GetTimeGeometry()), *(labelContent->GetTimeGeometry()), mitk::NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION, mitk::NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION)) |
| 979 | mitkThrow() << "Invalid use of AddLabel. labelContent has not the same geometry like the segmentation."; |
| 980 | |
| 981 | auto newLabel = this->AddLabel(label, groupID, addAsClone, correctLabelValue); |
| 982 | |
| 983 | mitk::TransferLabelContent(labelContent, this->GetGroupImage(groupID), this->GetConstLabelsByValue(this->GetLabelValuesByGroup(groupID)), |
| 984 | mitk::MultiLabelSegmentation::UNLABELED_VALUE, mitk::MultiLabelSegmentation::UNLABELED_VALUE, false, { {contentLabelValue, newLabel->GetValue()}}, |
| 985 | mitk::MultiLabelSegmentation::MergeStyle::Replace, mitk::MultiLabelSegmentation::OverwriteStyle::RegardLocks); |
| 986 | |
| 987 | this->Modified(); |
| 988 | |
| 989 | return newLabel; |
| 990 | } |
| 991 | |
| 992 | mitk::Label* mitk::MultiLabelSegmentation::AddLabel(const std::string& name, const mitk::Color& color, GroupIndexType groupID) |
| 993 | { |
no test coverage detected