def get_region_groups(regions):
    """
    Returns regions ids sorted into groups based on region label
    :param regions:
    :return: list of lists of region ids
    """
    prev = -1
    groups = []
    i = -1
    for r_id in range(len(regions)):
        r = regions[r_id]

        if r.label() > prev:
            prev = r.label()
            groups.append([r_id])
            i += 1
        else:
            groups[i].append(r_id)

    return groups