def get_lbs_for_random_crop(crop_size, data_shape, margins):
    '\n    :param crop_size:\n    :param data_shape: (b,c,x,y(,z)) must be the whole thing!\n    :param margins:\n    :return:\n    '
    lbs = []
    for i in range((len(data_shape) - 2)):
        if (((data_shape[(i + 2)] - crop_size[i]) - margins[i]) > margins[i]):
            lbs.append(np.random.randint(margins[i], ((data_shape[(i + 2)] - crop_size[i]) - margins[i])))
        else:
            lbs.append(((data_shape[(i + 2)] - crop_size[i]) // 2))
    return lbs
:param crop_size:
:param data_shape: (b,c,x,y(,z)) must be the whole thing!
:param margins:
:return:
def get_lbs_for_random_crop(crop_size, data_shape, margins):
    '\n    :param crop_size:\n    :param data_shape: (b,c,x,y(,z)) must be the whole thing!\n    :param margins:\n    :return:\n    '
    lbs = []
    for i in range((len(data_shape) - 2)):
        if (((data_shape[(i + 2)] - crop_size[i]) - margins[i]) > margins[i]):
            lbs.append(np.random.randint(margins[i], ((data_shape[(i + 2)] - crop_size[i]) - margins[i])))
        else:
            lbs.append(((data_shape[(i + 2)] - crop_size[i]) // 2))
    return lbs