| 21 | } |
| 22 | |
| 23 | void 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 | |
| 64 | void mitk::ImageTimeSelector::GenerateData() |
| 65 | { |
nothing calls this directly
no test coverage detected