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

Method GetLabelValuesByCoordinates

Modules/Multilabel/src/mitkLabelSetImage.cpp:1521–1551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1519}
1520
1521const 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
1553std::vector<std::string> mitk::MultiLabelSegmentation::GetLabelClassNames() const
1554{

Callers 2

UpdateLabelsMethod · 0.80

Calls 7

GetGroupImageMethod · 0.95
GetGeometryMethod · 0.80
valueMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
IsInsideMethod · 0.45

Tested by

no test coverage detected