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

Method SetGeometry

Modules/Core/src/DataManagement/mitkSlicedData.cpp:270–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270void 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
307void mitk::SlicedData::SetSpacing(const ScalarType aSpacing[])
308{

Callers

nothing calls this directly

Calls 9

GetGeometryFunction · 0.85
IsNotNullMethod · 0.80
NewFunction · 0.50
IsNullMethod · 0.45
GetPlaneGeometryMethod · 0.45
GetExtentMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected