| 89 | } |
| 90 | |
| 91 | mitk::TimeGeometry::Pointer mitk::CropTimestepsImageFilter::AdaptTimeGeometry(mitk::TimeGeometry::ConstPointer sourceGeometry, unsigned int startTimestep, unsigned int endTimestep) const |
| 92 | { |
| 93 | auto newTimeGeometry = mitk::ArbitraryTimeGeometry::New(); |
| 94 | newTimeGeometry->ClearAllGeometries(); |
| 95 | for (unsigned int timestep = startTimestep; timestep < endTimestep; timestep++) |
| 96 | { |
| 97 | auto geometryForTimePoint = sourceGeometry->GetGeometryForTimeStep(timestep); |
| 98 | auto minTP = sourceGeometry->GetMinimumTimePoint(timestep); |
| 99 | auto maxTP = sourceGeometry->GetMaximumTimePoint(timestep); |
| 100 | /////////////////////////////////////// |
| 101 | // Workaround T27883. See https://phabricator.mitk.org/T27883#219473 for more details. |
| 102 | // This workaround should be removed as soon as T28262 is solved! |
| 103 | if (timestep + 1 == sourceGeometry->CountTimeSteps() && minTP == maxTP) |
| 104 | { |
| 105 | maxTP = minTP + 1.; |
| 106 | } |
| 107 | // End of workaround for T27883 |
| 108 | ////////////////////////////////////// |
| 109 | |
| 110 | newTimeGeometry->AppendNewTimeStepClone(geometryForTimePoint, minTP, maxTP); |
| 111 | } |
| 112 | return newTimeGeometry.GetPointer(); |
| 113 | } |
| 114 | |
| 115 | void mitk::CropTimestepsImageFilter::GenerateData() |
| 116 | { |
nothing calls this directly
no test coverage detected