def gradients(self):
        """Return the gradient as a pair of numpy arrays.

        Returns
        -------
        :obj:`tuple` of :obj:`numpy.ndarray` of float
            The gradients of the image along each dimension.
        """
        g = np.gradient(self.data.astype(np.float32))
        return g
Return the gradient as a pair of numpy arrays.

        Returns
        -------
        :obj:`tuple` of :obj:`numpy.ndarray` of float
            The gradients of the image along each dimension.