| 75 | } |
| 76 | |
| 77 | py::array_t<double> ExtractDirection(const mitk::BaseGeometry& geom) |
| 78 | { |
| 79 | const auto& matrix = geom.GetIndexToWorldTransform()->GetMatrix(); |
| 80 | const auto spacing = geom.GetSpacing(); |
| 81 | |
| 82 | py::array_t<double> direction({static_cast<py::ssize_t>(3), static_cast<py::ssize_t>(3)}); |
| 83 | auto buf = direction.mutable_unchecked<2>(); |
| 84 | |
| 85 | for (int row = 0; row < 3; ++row) |
| 86 | for (int col = 0; col < 3; ++col) |
| 87 | buf(row, col) = matrix[row][col] / spacing[col]; |
| 88 | |
| 89 | return direction; |
| 90 | } |
| 91 | |
| 92 | py::array_t<double> GetDirection(const mitk::TimeGeometry* tg, mitk::TimeStepType t) |
| 93 | { |
no test coverage detected