def get_reverse_list(ori_shape, transforms):
    """
    get reverse list of transform.
    Args:
        ori_shape (list): Origin shape of image.
        transforms (list): List of transform.
    Returns:
        list: List of tuple, there are two format:
            ('resize', (h, w)) The image shape before resize,
            ('padding', (h, w)) The image shape before padding.
    """
    reverse_list = []
    d, h, w = ori_shape[0], ori_shape[1], ori_shape[2]
    for op in transforms:
        if op.__class__.__name__ in ['Resize3D']:
            reverse_list.append(('resize', (d, h, w)))
            d, h, w = op.size[0], op.size[1], op.size[2]

    return reverse_list

    get reverse list of transform.
    Args:
        ori_shape (list): Origin shape of image.
        transforms (list): List of transform.
    Returns:
        list: List of tuple, there are two format:
            ('resize', (h, w)) The image shape before resize,
            ('padding', (h, w)) The image shape before padding.
    
contrib/MedicalSeg/medicalseg/core/infer.py