13 #ifndef mitkTimeHelper_h
14 #define mitkTimeHelper_h
22 template <
class TOutputRegion,
class TInputRegion>
24 const TOutputRegion &outputRegion,
26 TInputRegion &inputRegion)
28 assert(outputTimeGeometry !=
nullptr);
29 assert(inputTimeGeometry !=
nullptr);
34 if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) &&
36 inputRegion.SetIndex(3, timestep);
38 inputRegion.SetIndex(3, 0);
40 timeInMS = outputTimeGeometry->
TimeStepToTimePoint(outputRegion.GetIndex(3) + outputRegion.GetSize(3) - 1);
42 if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) &&
44 inputRegion.SetSize(3, timestep - inputRegion.GetIndex(3) + 1);
46 inputRegion.SetSize(3, 1);
52 template <
class TOutputData,
class TInputData>
55 assert(output !=
nullptr);
56 assert(input !=
nullptr);
58 const typename TOutputData::RegionType &outputRegion = output->GetRequestedRegion();
59 typename TInputData::RegionType inputRegion;
61 if (outputRegion.GetSize(3) < 1)
63 typename TInputData::RegionType::SizeType inputsize;
65 inputRegion.SetSize(inputsize);
66 input->SetRequestedRegion(&inputRegion);
70 inputRegion = input->GetRequestedRegion();
72 input->SetRequestedRegion(&inputRegion);