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

Function MakeLabelVector

Wrapping/Python/mitk/MultiLabelSegmentation.cpp:168–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166{
167
168PyLabelVector MakeLabelVector(const LabelVector& src)
169{
170 PyLabelVector result;
171 result.items.reserve(src.size());
172 for (const auto& lbl : src)
173 result.items.push_back(lbl);
174
175 // Sort by label value for deterministic output
176 std::sort(result.items.begin(), result.items.end(),
177 [](const Label::Pointer& a, const Label::Pointer& b) {
178 return a->GetValue() < b->GetValue();
179 });
180
181 return result;
182}
183
184Label::AlgorithmType ParseAlgorithmType(const std::string& s)
185{

Callers 2

MakeLabelGroupFunction · 0.85

Calls 4

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected