def resample(data, shape):
    if isinstance(interpolation, UnsupportedPackage):
        interpolation.raise_error("segmentation_prediction_resample")
    if len(data.shape) != len(shape):
        raise RuntimeError('Dimensions of input array and shape are different. Resampling is impossible.')
    factor = [float(o) / i for i, o in zip(data.shape, shape)]
    return interpolation.zoom(data, zoom=factor, order=1)
    def configure(self):
        if isinstance(interpolation, UnsupportedPackage):
            interpolation.raise_error(self.__provider__)

        self.shape = self._check_size(
            get_or_parse_value(self.config.get('size'),
                               default=(128, 128, 128),
                               casting_type=int))