| 268 | } |
| 269 | |
| 270 | void mitk::SlicedData::SetGeometry(BaseGeometry *aGeometry3D) |
| 271 | { |
| 272 | if (aGeometry3D != nullptr) |
| 273 | { |
| 274 | ProportionalTimeGeometry::Pointer timeGeometry = ProportionalTimeGeometry::New(); |
| 275 | SlicedGeometry3D::Pointer slicedGeometry = dynamic_cast<SlicedGeometry3D *>(aGeometry3D); |
| 276 | if (slicedGeometry.IsNull()) |
| 277 | { |
| 278 | auto *geometry2d = dynamic_cast<PlaneGeometry *>(aGeometry3D); |
| 279 | if (geometry2d != nullptr && dynamic_cast<mitk::AbstractTransformGeometry *>(aGeometry3D) == nullptr) |
| 280 | { |
| 281 | if ((GetSlicedGeometry()->GetPlaneGeometry(0) == geometry2d) && (GetSlicedGeometry()->GetSlices() == 1)) |
| 282 | return; |
| 283 | slicedGeometry = SlicedGeometry3D::New(); |
| 284 | slicedGeometry->InitializeEvenlySpaced(geometry2d, 1); |
| 285 | } |
| 286 | else |
| 287 | { |
| 288 | slicedGeometry = SlicedGeometry3D::New(); |
| 289 | PlaneGeometry::Pointer planeGeometry = PlaneGeometry::New(); |
| 290 | planeGeometry->InitializeStandardPlane(aGeometry3D); |
| 291 | slicedGeometry->InitializeEvenlySpaced(planeGeometry, (unsigned int)(aGeometry3D->GetExtent(2))); |
| 292 | } |
| 293 | } |
| 294 | assert(slicedGeometry.IsNotNull()); |
| 295 | |
| 296 | timeGeometry->Initialize(slicedGeometry, 1); |
| 297 | Superclass::SetTimeGeometry(timeGeometry); |
| 298 | } |
| 299 | else |
| 300 | { |
| 301 | if (GetGeometry() == nullptr) |
| 302 | return; |
| 303 | Superclass::SetGeometry(nullptr); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | void mitk::SlicedData::SetSpacing(const ScalarType aSpacing[]) |
| 308 | { |
nothing calls this directly
no test coverage detected