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

Function InitMultiLabelSegmentation

Wrapping/Python/mitk/MultiLabelSegmentation.cpp:381–2113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379// ---------------------------------------------------------------------------
380
381void InitMultiLabelSegmentation(py::module_& m)
382{
383 // =======================================================================
384 // mitk.DICOMCodeSequence
385 // =======================================================================
386 py::class_<DICOMCodeSequence>(m, "DICOMCodeSequence",
387 R"(DICOM coded entry: a ``(value, scheme, meaning)`` triple.
388
389Used to identify standardized concepts in DICOM (anatomic regions,
390segmented property types, ...). For example::
391
392 DICOMCodeSequence("T-A0095", "SRT", "Brain")
393
394Most MITK APIs that take a ``DICOMCodeSequence`` also accept a
395``(value, scheme, meaning)`` 3-tuple for convenience.
396)")
397 .def(py::init<>(),
398 "Construct an empty coded entry.")
399 .def(py::init<const std::string&, const std::string&, const std::string&>(),
400 py::arg("value"), py::arg("scheme"), py::arg("meaning"),
401 R"(Construct a coded entry.
402
403Args:
404 value: Code value (e.g. ``"T-A0095"``).
405 scheme: Coding scheme designator (e.g. ``"SRT"``).
406 meaning: Human-readable meaning (e.g. ``"Brain"``).
407)")
408 .def_property("value", &DICOMCodeSequence::GetValue, &DICOMCodeSequence::SetValue)
409 .def_property("scheme", &DICOMCodeSequence::GetScheme, &DICOMCodeSequence::SetScheme)
410 .def_property("meaning", &DICOMCodeSequence::GetMeaning, &DICOMCodeSequence::SetMeaning)
411 .def_property_readonly("is_empty", &DICOMCodeSequence::IsEmpty)
412 .def("__eq__", &DICOMCodeSequence::operator==, py::is_operator())
413 .def("__ne__", &DICOMCodeSequence::operator!=, py::is_operator())
414 .def("__repr__", [](const DICOMCodeSequence& c) {
415 std::ostringstream os;
416 os << "DICOMCodeSequence(value='" << c.GetValue()
417 << "', scheme='" << c.GetScheme()
418 << "', meaning='" << c.GetMeaning() << "')";
419 return os.str();
420 });
421
422 // =======================================================================
423 // mitk.DICOMCodeSequenceWithModifiers
424 // =======================================================================
425 py::class_<DICOMCodeSequenceWithModifiers, DICOMCodeSequence>(m, "DICOMCodeSequenceWithModifiers",
426 R"(:py:class:`DICOMCodeSequence` extended with optional modifier sequences.
427
428Used by DICOM constructs that allow further qualification of a coded
429entry (for example "Liver" + modifier "Left lobe").
430)")
431 .def(py::init<>(),
432 "Construct an empty coded entry with no modifiers.")
433 .def(py::init<const std::string&, const std::string&, const std::string&>(),
434 py::arg("value"), py::arg("scheme"), py::arg("meaning"),
435 R"(Construct a coded entry without modifiers.
436
437Args:
438 value: Code value.

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls 15

ToDICOMCodeSequenceFunction · 0.85
TupleToColorFunction · 0.85
ColorToTupleFunction · 0.85
ParseAlgorithmTypeFunction · 0.85
Point3DToTupleFunction · 0.85
LabelRowHtmlFunction · 0.85
bind_property_ownerFunction · 0.85
ToLabelValueFunction · 0.85
GroupHeaderRowHtmlFunction · 0.85
MakeLabelVectorFunction · 0.85

Tested by

no test coverage detected