| 264 | } |
| 265 | |
| 266 | mitk::Point3D mitk::BaseGeometry::GetCenter() const |
| 267 | { |
| 268 | assert(m_BoundingBox.IsNotNull()); |
| 269 | Point3D c = m_BoundingBox->GetCenter(); |
| 270 | if (m_ImageGeometry) |
| 271 | { |
| 272 | // Get Center returns the middle of min and max pixel index. In corner based images, this is the right position. |
| 273 | // In center based images (imageGeometry == true), the index needs to be shifted back. |
| 274 | c[0] -= 0.5; |
| 275 | c[1] -= 0.5; |
| 276 | c[2] -= 0.5; |
| 277 | } |
| 278 | this->IndexToWorld(c, c); |
| 279 | return c; |
| 280 | } |
| 281 | |
| 282 | double mitk::BaseGeometry::GetDiagonalLength2() const |
| 283 | { |