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

Method SplitLabelValuesByGroup

Modules/Multilabel/src/mitkLabelSetImageHelper.cpp:306–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306mitk::LabelSetImageHelper::GroupIDToLabelValueMapType
307mitk::LabelSetImageHelper::SplitLabelValuesByGroup(const MultiLabelSegmentation* labelSetImage, const MultiLabelSegmentation::LabelValueVectorType& labelValues)
308{
309 if (nullptr == labelSetImage)
310 mitkThrow() << "Cannot split label values. Invalid MultiLabelSegmentation pointer passed";
311
312 GroupIDToLabelValueMapType result;
313
314 for (auto value : labelValues)
315 {
316 auto groupID = labelSetImage->GetGroupIndexOfLabel(value);
317
318 //if groupID does not exist in result this call will also init an empty vector.
319 result[groupID].push_back(value);
320 }
321
322 return result;
323}
324
325mitk::LabelSetImageHelper::LabelClassNameToLabelValueMapType
326mitk::LabelSetImageHelper::SplitLabelValuesByClassName(const MultiLabelSegmentation* labelSetImage, MultiLabelSegmentation::GroupIndexType groupID)

Callers

nothing calls this directly

Calls 1

GetGroupIndexOfLabelMethod · 0.80

Tested by

no test coverage detected