20 #ifndef MIRTK_RepeatExtrapolateImageFunction_H 21 #define MIRTK_RepeatExtrapolateImageFunction_H 23 #include "mirtk/ExtrapolateImageFunction.h" 25 #include "mirtk/Math.h" 26 #include "mirtk/BaseImage.h" 37 template <
class TImage>
41 mirtkExtrapolatorMacro(
56 static void Apply(
int &index,
int max)
58 if (index < 0 ) index = max + (index + 1) % (max + 1);
59 else if (index > max) index = index % (max + 1);
64 static void Apply(
double &cindex,
int max)
66 int index =
ifloor(cindex);
67 double fraction = cindex - index;
69 cindex = index + fraction;
104 #endif // MIRTK_RepeatExtrapolateImageFunction_H
MIRTKCU_API int ifloor(T x)
Round floating-point value to next smaller integer and cast to int.