def positions_to_selection(top_left_inclusive, bottom_right_exclusive):
    """Return a selection object for an image as specified by positions.

    Note that the bottom right point will not be included in the selection.

    :top_left_inclusive: a numpy.array of (top, left) co-ordinates
    :bottom_right_exclusive: a numpy.array of (bottom, right) co-ordinates
    :returns: A tuple (rows, columns) slices as a selection object
    """
    return (
        slice(top_left_inclusive[1], bottom_right_exclusive[1]),
        slice(top_left_inclusive[0], bottom_right_exclusive[0]),
    )