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

Function InitTimeGeometry

Wrapping/Python/mitk/Geometries.cpp:262–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void InitTimeGeometry(py::module_& m)
263{
264 py::class_<TimeGeometry, TimeGeometry::Pointer>(m, "TimeGeometry",
265 R"(Maps discrete time steps to floating-point time points.
266
267A ``TimeGeometry`` is the temporal counterpart of :py:class:`BaseGeometry`.
268It bridges integer time-step indices (used as array indices) and physical
269time points (the time values a user sees). For static 3D data the time
270geometry has a single time step that covers the full time range.
271
272Subclasses:
273
274- :py:class:`ProportionalTimeGeometry`: evenly spaced time points.
275- :py:class:`ArbitraryTimeGeometry`: user-defined time points per step.
276)")
277 .def("count_time_steps", &TimeGeometry::CountTimeSteps,
278 "Return the number of time steps.")
279 .def("get_min_time_point", py::overload_cast<>(&TimeGeometry::GetMinimumTimePoint, py::const_),
280 "Return the minimum (earliest) time point covered by this geometry.")
281 .def("get_max_time_point", py::overload_cast<>(&TimeGeometry::GetMaximumTimePoint, py::const_),
282 "Return the maximum (latest) time point covered by this geometry.")
283 .def("get_min_time_point", py::overload_cast<TimeStepType>(&TimeGeometry::GetMinimumTimePoint, py::const_), py::arg("time_step"),
284 R"(Return the minimum time point of a single time step.
285
286Args:
287 time_step: Time-step index.
288)")
289 .def("get_max_time_point", py::overload_cast<TimeStepType>(&TimeGeometry::GetMaximumTimePoint, py::const_), py::arg("time_step"),
290 R"(Return the maximum time point of a single time step.
291
292Args:
293 time_step: Time-step index.
294)")
295 .def("get_time_bounds",
296 [](const TimeGeometry& tg) {
297 const auto b = tg.GetTimeBounds();
298 return std::make_tuple(b[0], b[1]);
299 },
300 R"(Return the overall ``(min_time_point, max_time_point)`` tuple.
301
302Returns:
303 A 2-tuple of floats.
304)")
305 .def("get_time_bounds",
306 [](const TimeGeometry& tg, TimeStepType t) {
307 const auto b = tg.GetTimeBounds(t);
308 return std::make_tuple(b[0], b[1]);
309 },
310 py::arg("time_step"),
311 R"(Return the ``(min, max)`` time-point tuple for a single time step.
312
313Args:
314 time_step: Time-step index.
315
316Returns:
317 A 2-tuple of floats.
318)")
319 .def("time_step_to_time_point", &TimeGeometry::TimeStepToTimePoint, py::arg("time_step"),

Callers 1

InitGeometriesFunction · 0.85

Calls 1

GetTimeBoundsMethod · 0.45

Tested by

no test coverage detected