17 #ifndef MITKTIMEHELPER_H_HEADER_INCLUDED_C1C2FCD2
18 #define MITKTIMEHELPER_H_HEADER_INCLUDED_C1C2FCD2
26 template <
class TOutputRegion,
class TInputRegion>
28 const TOutputRegion &outputRegion,
30 TInputRegion &inputRegion)
32 assert(outputTimeGeometry !=
nullptr);
33 assert(inputTimeGeometry !=
nullptr);
38 if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) &&
40 inputRegion.SetIndex(3, timestep);
42 inputRegion.SetIndex(3, 0);
44 timeInMS = outputTimeGeometry->
TimeStepToTimePoint(outputRegion.GetIndex(3) + outputRegion.GetSize(3) - 1);
46 if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) &&
48 inputRegion.SetSize(3, timestep - inputRegion.GetIndex(3) + 1);
50 inputRegion.SetSize(3, 1);
56 template <
class TOutputData,
class TInputData>
59 assert(output !=
nullptr);
60 assert(input !=
nullptr);
62 const typename TOutputData::RegionType &outputRegion = output->GetRequestedRegion();
63 typename TInputData::RegionType inputRegion;
65 if (outputRegion.GetSize(3) < 1)
67 typename TInputData::RegionType::SizeType inputsize;
69 inputRegion.SetSize(inputsize);
70 input->SetRequestedRegion(&inputRegion);
74 inputRegion = input->GetRequestedRegion();
76 input->SetRequestedRegion(&inputRegion);
81 #endif // MITKTIMEHELPER_H_HEADER_INCLUDED_C1C2FCD2
DataCollection - Class to facilitate loading/accessing structured data.
virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const =0
Converts a time point to the corresponding time step.
virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const =0
Converts a time step to a time point.
mitk::ScalarType TimePointType
std::vcl_size_t TimeStepType
void GenerateTimeInInputRegion(const mitk::TimeGeometry *outputTimeGeometry, const TOutputRegion &outputRegion, const mitk::TimeGeometry *inputTimeGeometry, TInputRegion &inputRegion)
virtual bool IsValidTimeStep(TimeStepType timeStep) const =0
Test for the given time step if a geometry is availible.