def _bounds_side(size, max_pixels, overlap, coord, axis):
    """Calculates the boundaries of a side based on where in the
    ROI the current sub-ROI is.
    
    Attributes:
        size: Size in (z, y, x) order.
        overlap: Overlap size between sub-ROIs.
        coord: Coordinates of the sub-ROI, in (z, y, x) order.
        axis: The axis to calculate.
    
    Returns:
        int, int: Boundary of sides for the given ``axis`` as ``start, end``.
    """
    pixels = max_pixels[axis]
    start = coord[axis] * pixels
    end = start + pixels
    if overlap is not None:
        end += overlap[axis]
    if end > size[axis]:
        end = size[axis]
    return int(start), int(end)