| 1519 | } |
| 1520 | |
| 1521 | const mitk::MultiLabelSegmentation::LabelValueVectorType mitk::MultiLabelSegmentation::GetLabelValuesByCoordinates(const Point3D& coordinates, |
| 1522 | TimeStepType timeStep, std::optional<GroupIndexType> index) const |
| 1523 | { |
| 1524 | std::vector<GroupIndexType> relevantGroups; |
| 1525 | if (index.has_value()) |
| 1526 | { |
| 1527 | relevantGroups.push_back(index.value()); |
| 1528 | } |
| 1529 | else |
| 1530 | { |
| 1531 | relevantGroups.resize(m_GroupContainer.size()); |
| 1532 | std::iota(relevantGroups.begin(), relevantGroups.end(), 0); |
| 1533 | } |
| 1534 | |
| 1535 | mitk::MultiLabelSegmentation::LabelValueVectorType result; |
| 1536 | |
| 1537 | if (!this->GetGeometry(timeStep)->IsInside(coordinates)) |
| 1538 | return result; |
| 1539 | |
| 1540 | for (auto groupIndex : relevantGroups) |
| 1541 | { |
| 1542 | auto groupImage = this->GetGroupImage(groupIndex); |
| 1543 | mitk::ImagePixelReadAccessor<mitk::MultiLabelSegmentation::LabelValueType, 3> pixelReader(SelectImageByTimeStep(groupImage,timeStep)); |
| 1544 | |
| 1545 | if (auto pixel = pixelReader.GetPixelByWorldCoordinates(coordinates); pixel != MultiLabelSegmentation::UNLABELED_VALUE) |
| 1546 | { |
| 1547 | result.emplace_back(pixel); |
| 1548 | } |
| 1549 | } |
| 1550 | return result; |
| 1551 | } |
| 1552 | |
| 1553 | std::vector<std::string> mitk::MultiLabelSegmentation::GetLabelClassNames() const |
| 1554 | { |
no test coverage detected