| 28 | */ |
| 29 | template <class TOutputRegion, class TInputRegion> |
| 30 | void GenerateTimeInInputRegion(const mitk::TimeGeometry *outputTimeGeometry, |
| 31 | const TOutputRegion &outputRegion, |
| 32 | const mitk::TimeGeometry *inputTimeGeometry, |
| 33 | TInputRegion &inputRegion) |
| 34 | { |
| 35 | assert(outputTimeGeometry != nullptr); |
| 36 | assert(inputTimeGeometry != nullptr); |
| 37 | |
| 38 | // convert the start-index-time of output in start-index-time of input via millisecond-time |
| 39 | mitk::TimePointType timeInMS = outputTimeGeometry->TimeStepToTimePoint(outputRegion.GetIndex(3)); |
| 40 | mitk::TimeStepType timestep = inputTimeGeometry->TimePointToTimeStep(timeInMS); |
| 41 | if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) && |
| 42 | (inputTimeGeometry->IsValidTimeStep(timestep))) |
| 43 | inputRegion.SetIndex(3, timestep); |
| 44 | else |
| 45 | inputRegion.SetIndex(3, 0); |
| 46 | // convert the end-index-time of output in end-index-time of input via millisecond-time |
| 47 | timeInMS = outputTimeGeometry->TimeStepToTimePoint(outputRegion.GetIndex(3) + outputRegion.GetSize(3) - 1); |
| 48 | timestep = inputTimeGeometry->TimePointToTimeStep(timeInMS); |
| 49 | if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) && |
| 50 | (outputTimeGeometry->IsValidTimeStep(timestep))) |
| 51 | inputRegion.SetSize(3, timestep - inputRegion.GetIndex(3) + 1); |
| 52 | else |
| 53 | inputRegion.SetSize(3, 1); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * \brief Convert the start- and end-index-time of output in |
no test coverage detected