def sliding_box(start, stop, size, step=1):
    """
    Find sliding boxes of region

    Parameters:
    -----------
    start: int
        0 based start coordinate of the region.
    stop : int
        0 based stop coordinate of the region, i.e. stop is not part of the
        region anymore;
    size : int
        The size of the box regions
    step : int, optional
        The step size of the sliding box.

    Return
    ------
    regions : list
        List of tuples (start,stop) with the extracted regions.
    """
    # we need to truncate if step is no multiple of stop-start
    if (stop - start) / step != 0:
        overhead = (stop-start) % step

        if overhead % 2 == 0:
            start += overhead // 2
            stop -= overhead // 2
        else:
            start += overhead // 2
            stop -= overhead // 2 + 1
    regions = []
    for i in range(0,(stop - start),step):
        regions.append((i+start, i+start+size))
    return regions