Extract

template<typename Func, typename BoundaryFunc, int Dim>
static void interpolation::extract(Data<Func, Dim> &chunk, const pybind11::detail::unchecked_reference<typename Func::VALUE_TYPE, Dim> &image, std::array<int, Dim> &point_floored, typename Func::VALUE_TYPE background_value)

Extract interpolation patch from given data around given position.

Different interpolation schemes require a different number of points to operate. This function takes the appropriate chunk and fills it with data based on the information of the function given.

Parameters:
  • chunk[inout] N-dimensional array data for the interpolation. Needs the right number of points in each dimension, e.g. 4 for cubic interpolation.

  • image[in] The image from which to extract the data.

  • point_floored[inout] The point in the image where to interpolate floored. Will point to the lower corner of the data grid used for the interpolation at the end.

  • background_value[in] The background value to use in case the value is outside the image domain (might be ignored depending on the boundary function used)

Template Parameters:
  • Func – The interpolation order func

  • BoundaryFunc – The boundary type to use. E.g. ConstantBoundary

  • Dim – The dimensionality of the given image