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

Function RequireGroup

Wrapping/Python/mitk/MultiLabelSegmentation.cpp:219–223  ·  view source on GitHub ↗

A group index is positional (list-like) -> IndexError; a label value is a sparse key (dict-like) -> KeyError. Both subclass Python's LookupError, so callers can catch any miss uniformly.

Source from the content-addressed store, hash-verified

217// sparse key (dict-like) -> KeyError. Both subclass Python's LookupError, so
218// callers can catch any miss uniformly.
219void RequireGroup(const MultiLabelSegmentation& seg, MultiLabelSegmentation::GroupIndexType index)
220{
221 if (!seg.ExistGroup(index))
222 throw py::index_error("Group index " + std::to_string(index) + " does not exist");
223}
224
225void RequireLabel(const MultiLabelSegmentation& seg, Label::PixelType value)
226{

Callers 1

Calls 1

ExistGroupMethod · 0.80

Tested by

no test coverage detected