'Get the image extent: left, right, bottom, top'

def get_extent(self):

    if (self._extent is not None):
        return self._extent
    else:
        sz = self.get_size()
        (numrows, numcols) = sz
        if (self.origin == u'upper'):
            return ((-0.5), (numcols - 0.5), (numrows - 0.5), (-0.5))
        else:
            return ((-0.5), (numcols - 0.5), (-0.5), (numrows - 0.5))
