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

Method GetLabelsByValue

Modules/Multilabel/src/mitkLabelSetImage.cpp:1459–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1457}
1458
1459const mitk::MultiLabelSegmentation::LabelVectorType mitk::MultiLabelSegmentation::GetLabelsByValue(const LabelValueVectorType& labelValues, bool ignoreMissing)
1460{
1461 LabelVectorType result;
1462 for (const auto& labelValue : labelValues)
1463 {
1464 Label::Pointer label = this->GetLabel(labelValue);
1465
1466 if (label.IsNotNull())
1467 {
1468 result.emplace_back(label);
1469 }
1470 else if (!ignoreMissing) mitkThrow() << "Error cannot get labels by Value. At least one passed value is unknown. Unknown value: " << labelValue;
1471 }
1472 return result;
1473}
1474
1475const mitk::MultiLabelSegmentation::ConstLabelVectorType mitk::MultiLabelSegmentation::GetConstLabelsByValue(const LabelValueVectorType& labelValues, bool ignoreMissing) const
1476{

Callers 5

ApplyToLabelsMethod · 0.95
MakeLabelGroupFunction · 0.80

Calls 2

GetLabelMethod · 0.95
IsNotNullMethod · 0.80

Tested by

no test coverage detected