code: 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
  
file_path: PaddleSeg/contrib/MedicalSeg/medicalseg/core/infer.py
imports: import collections.abc
  import paddle
  import paddle
  import paddle.nn.functional
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: get_reverse_list(ori_shape, transforms) and returns: reverse_list