26 #include <pybind11/pybind11.h>
28 namespace py = pybind11;
36 if (!tsProp)
return false;
38 result[
"type"] =
"TemporoSpatialStringProperty";
41 for (
auto ts : tsProp->GetAvailableTimeSteps())
42 for (
auto slice : tsProp->GetAvailableSlices(ts))
43 entries.append(py::make_tuple(ts, slice, tsProp->GetValue(ts, slice)));
45 result[
"entries"] = entries;
52 if (d[
"type"].cast<std::string>() !=
"TemporoSpatialStringProperty")
57 for (
auto entry : d[
"entries"].cast<py::list>())
59 auto t = entry.cast<py::tuple>();
60 prop->SetValue(t[0].cast<mitk::TimeStepType>(),
62 t[2].cast<std::string>());
65 return prop.GetPointer();
Abstract base class for properties.
Property for storing string values resolved by time step and slice index.
::itk::IndexValueType IndexValueType
Index type for slice indices.
mitk::BaseProperty::Pointer tryDictToTemporoSpatialString(const py::dict &d)
bool tryTemporoSpatialStringToDict(const mitk::BaseProperty &prop, py::dict &result)