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

Method GenerateOutputInformation

Modules/Core/src/Algorithms/mitkImageTimeSelector.cpp:23–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void mitk::ImageTimeSelector::GenerateOutputInformation()
24{
25 Image::ConstPointer input = this->GetInput();
26 Image::Pointer output = this->GetOutput();
27
28 itkDebugMacro(<< "GenerateOutputInformation()");
29
30 int dim = (input->GetDimension() < 3 ? input->GetDimension() : 3);
31 output->Initialize(input->GetPixelType(), dim, input->GetDimensions());
32
33 if ((unsigned int)m_TimeNr >= input->GetDimension(3))
34 {
35 m_TimeNr = input->GetDimension(3) - 1;
36 }
37
38 // initialize geometry
39 mitk::SlicedGeometry3D::Pointer sliced_geo = input->GetSlicedGeometry(m_TimeNr);
40 if (sliced_geo.IsNull())
41 {
42 mitkThrow() << "Failed to retrieve SlicedGeometry from input at timestep " << m_TimeNr;
43 }
44
45 mitk::SlicedGeometry3D::Pointer sliced_geo_clone = sliced_geo->Clone();
46 if (sliced_geo_clone.IsNull())
47 {
48 mitkThrow() << "Failed to clone the retrieved sliced geometry.";
49 }
50
51 mitk::BaseGeometry::Pointer geom_3d = dynamic_cast<BaseGeometry *>(sliced_geo_clone.GetPointer());
52 if (geom_3d.IsNotNull())
53 {
54 output->SetGeometry(geom_3d.GetPointer());
55 }
56 else
57 {
58 mitkThrow() << "Failed to cast the retrieved SlicedGeometry to a Geometry3D object.";
59 }
60
61 output->SetPropertyList(input->GetPropertyList()->Clone());
62}
63
64void mitk::ImageTimeSelector::GenerateData()
65{

Callers

nothing calls this directly

Calls 14

GetDimensionsMethod · 0.80
GetSlicedGeometryMethod · 0.80
GetPointerMethod · 0.80
IsNotNullMethod · 0.80
GetInputMethod · 0.45
GetOutputMethod · 0.45
GetDimensionMethod · 0.45
InitializeMethod · 0.45
GetPixelTypeMethod · 0.45
IsNullMethod · 0.45
CloneMethod · 0.45
SetGeometryMethod · 0.45

Tested by

no test coverage detected