def roi_center(roi):
    """Return center point of an ``roi``."""

    def slice_center(s):
        return (s.start + s.stop) * 0.5

    if isinstance(roi, slice):
        return slice_center(roi)

    return tuple(slice_center(s) for s in roi)