def get_bbox_region(bbox, padding=0, img_shape=None):
    """Get slices from a bounding box from which to extract the ROI 
    from the original image as a view and with an optional padding.
    
    Args:
        bbox: Bounding box as given by :func:``get_label_bbox``.
        padding: Int of padding in pixels outside of the box to include; 
            defaults to 0.
        img_shape: Sequence of maximum output coordinates, where any 
            end coordinate will be truncated to the corresponding 
            value. Defaults to None.
    
    Returns:
        Tuple of the ROI shape and list of ROI slices containing the 
        start and end indices of the ROI along each axis.
    """
    dims = len(bbox) // 2  # bbox has min vals for each dim, then maxes
    shape = [bbox[i + dims] - bbox[i] for i in range(dims)]
    slices = []
    for i in range(dims):
        # add padding for slices and update shape
        start = bbox[i] - padding
        stop = bbox[i] + shape[i] + padding
        if img_shape is not None:
            if start < 0: start = 0
            if stop >= img_shape[i]: stop = img_shape[i]
        slices.append(slice(start, stop))
        shape[i] = stop - start
    #print("shape: {}, slices: {}".format(shape, slices))
    return shape, slices