menpo/image/base.py
def resize(self, shape, order=1):
        r"""
        Return a copy of this image, resized to a particular shape.
        All image information (landmarks, and mask in the case of
        :map:`MaskedImage`) is resized appropriately.

        Parameters
        ----------
        shape : `tuple`
            The new shape to resize to.
        order : `int`, optional
            The order of interpolation. The order has to be in the range [0,5]

            ========= =====================
            Order     Interpolation
            ========= =====================
            0         Nearest-neighbor
            1         Bi-linear *(default)*
            2         Bi-quadratic
            3         Bi-cubic
            4         Bi-quartic
            5         Bi-quintic
            ========= =====================

        Returns
        -------
        resized_image : ``type(self)``
            A copy of this image, resized.

        Raises
        ------
        ValueError:
            If the number of dimensions of the new shape does not match
            the number of dimensions of the image.
        """
        shape = np.asarray(shape, dtype=np.float)
        if len(shape) != self.n_dims:
            raise ValueError(
                'Dimensions must match.'
                '{} dimensions provided, {} were expected.'.format(
                    shape.shape, self.n_dims))
        scales = shape / self.shape
        # Have to round the shape when scaling to deal with floating point
        # errors. For example, if we want (250, 250), we need to ensure that
        # we get (250, 250) even if the number we obtain is 250 to some
        # floating point inaccuracy.
        return self.rescale(scales, round='round', order=order)
r"""
        Return a copy of this image, resized to a particular shape.
        All image information (landmarks, and mask in the case of
        :map:`MaskedImage`) is resized appropriately.

        Parameters
        ----------
        shape : `tuple`
            The new shape to resize to.
        order : `int`, optional
            The order of interpolation. The order has to be in the range [0,5]

            ========= =====================
            Order     Interpolation
            ========= =====================
            0         Nearest-neighbor
            1         Bi-linear *(default)*
            2         Bi-quadratic
            3         Bi-cubic
            4         Bi-quartic
            5         Bi-quintic
            ========= =====================

        Returns
        -------
        resized_image : ``type(self)``
            A copy of this image, resized.

        Raises
        ------
        ValueError:
            If the number of dimensions of the new shape does not match
            the number of dimensions of the image.
        
r"""
Return a copy of this image, resized to a particular shape.
All image information (landmarks, and mask in the case of
r " " " Return a copy of this image resized to a particular shape . All image information ( landmarks and mask in the case of
def resize(self, shape, order=1):
        shape = np.asarray(shape, dtype=np.float)
        if len(shape) != self.n_dims:
            raise ValueError(
                'Dimensions must match.'
                '{} dimensions provided, {} were expected.'.format(
                    shape.shape, self.n_dims))
        scales = shape / self.shape
        return self.rescale(scales, round='round', order=order)
def resize ( self , shape , order = 1 ) : shape = np . asarray ( shape , dtype = np . float ) if len ( shape ) != self . n_dims : raise ValueError ( 'Dimensions must match.' '{} dimensions provided, {} were expected.' . format ( shape . shape , self . n_dims ) ) scales = shape / self . shape return self . rescale ( scales , round = 'round' , order = order )
r"""
Return a copy of this image, resized to a particular shape.
r " " " Return a copy of this image resized to a particular shape .
r"""
        Return a copy of this image, resized to a particular shape.
        All image information (landmarks, and mask in the case of
        :map:`MaskedImage`) is resized appropriately.

        Parameters
        ----------
        shape : `tuple`
            The new shape to resize to.
        order : `int`, optional
            The order of interpolation. The order has to be in the range [0,5]

            ========= =====================
            Order     Interpolation
            ========= =====================
            0         Nearest-neighbor
            1         Bi-linear *(default)*
            2         Bi-quadratic
            3         Bi-cubic
            4         Bi-quartic
            5         Bi-quintic
            ========= =====================

        Returns
        -------
        resized_image : ``type(self)``
            A copy of this image, resized.

        Raises
        ------
        ValueError:
            If the number of dimensions of the new shape does not match
            the number of dimensions of the image.
        """ # Have to round the shape when scaling to deal with floating point # errors. For example, if we want (250, 250), we need to ensure that # we get (250, 250) even if the number we obtain is 250 to some # floating point inaccuracy.
self
shape
order
map
`MaskedImage`) is resized appropriately.
Parameters

shape : `tuple`
The new shape to resize to.
order : `int`, optional
The order of interpolation. The order has to be in the range [0,5]

Order     Interpolation

0         Nearest-neighbor
1         Bi-linear *(default)
2         Bi-quadratic
3         Bi-cubic
4         Bi-quartic
5         Bi-quintic

Returns

resized_image : ``type(self)``
A copy of this image, resized.

Raises

If the number of dimensions of the new shape does not match
the number of dimensions of the image.
` MaskedImage ` ) is resized appropriately . Parameters shape : ` tuple ` The new shape to resize to . order : ` int ` optional The order of interpolation . The order has to be in the range [ 0 5 ] Order Interpolation 0 Nearest - neighbor 1 Bi - linear * ( default ) 2 Bi - quadratic 3 Bi - cubic 4 Bi - quartic 5 Bi - quintic Returns resized_image : ` ` type ( self ) ` ` A copy of this image resized . Raises If the number of dimensions of the new shape does not match the number of dimensions of the image .