code: def get_roi_image_nd(image_nd, object_roi, target_size):
      rmin, rmax, cmin, cmax = object_roi
  
      height = rmax - rmin + 1
      width = cmax - cmin + 1
  
      if isinstance(target_size, tuple):
          new_height, new_width = target_size
      else:
          scale = target_size / max(height, width)
          new_height = int(round(height * scale))
          new_width = int(round(width * scale))
  
      with paddle.no_grad():
          roi_image_nd = image_nd[
              :, :, rmin : rmax + 1, cmin : cmax + 1
          ]
          roi_image_nd = paddle.nn.functional.interpolate(
              roi_image_nd,
              size=(new_height, new_width),
              mode="bilinear",
              align_corners=True,
          )
  
      return roi_image_nd
  
file_path: PaddleSeg/EISeg/eiseg/inference/transforms/zoom_in.py
imports: import paddle
  import numpy
  from inference.clicker import Click
  from util.misc import get_bbox_iou, get_bbox_from_mask, expand_bbox, clamp_bbox
  from .base import BaseTransform
label_desc: Use image node_id 2 for calling a global function with example usage: get_roi_image_nd(image_nd, object_roi, target_size) and returns: roi_image_nd