| 420 | } |
| 421 | |
| 422 | mitk::Point3D mitk::BaseGeometry::ClampPoint(const Point3D& point) const |
| 423 | { |
| 424 | if (this->IsInside(point)) |
| 425 | return point; |
| 426 | |
| 427 | auto origin = this->GetOrigin(); |
| 428 | |
| 429 | if (this->GetImageGeometry()) |
| 430 | origin -= this->GetSpacing() * 0.5; |
| 431 | |
| 432 | Point3D clampedPoint; |
| 433 | |
| 434 | for (int i = 0; i < 3; ++i) |
| 435 | clampedPoint[i] = std::max(origin[i], std::min(point[i], origin[i] + this->GetExtentInMM(i))); |
| 436 | |
| 437 | return clampedPoint; |
| 438 | } |
| 439 | |
| 440 | void mitk::BaseGeometry::WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const |
| 441 | { |
no test coverage detected