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

Method AdaptTimeGeometry

Modules/AlgorithmsExt/src/mitkCropTimestepsImageFilter.cpp:91–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
115void mitk::CropTimestepsImageFilter::GenerateData()
116{

Callers

nothing calls this directly

Calls 8

GetPointerMethod · 0.80
NewFunction · 0.50
ClearAllGeometriesMethod · 0.45
GetMinimumTimePointMethod · 0.45
GetMaximumTimePointMethod · 0.45
CountTimeStepsMethod · 0.45

Tested by

no test coverage detected