def rescale_to_diagonal(self, diagonal, round='ceil',
                            return_transform=False):
        r"""
        Return a copy of this image, rescaled so that the it's diagonal is a
        new size.

        Parameters
        ----------
        diagonal: `int`
            The diagonal size of the new image.
        round: ``{ceil, floor, round}``, optional
            Rounding function to be applied to floating point shapes.
        return_transform : `bool`, optional
            If ``True``, then the :map:`Transform` object that was used to
            perform the rescale is also returned.

        Returns
        -------
        rescaled_image : type(self)
            A copy of this image, rescaled.
        transform : :map:`Transform`
            The transform that was used. It only applies if
            `return_transform` is ``True``.
        """
        return self.rescale(diagonal / self.diagonal(), round=round,
                            return_transform=return_transform)
dataset/ETHPy150Open menpo/menpo/menpo/image/base.py/Image.rescale_to_diagonal/original