{This resampler shows unreliable behaviour: depending of the platform it does not always resample the last element along each axis correctly. Also, it uses some clever optimizations that do not check for overflow. If you need such a masked resampler, please consider contributing a fixed version.}