code: def _get_scan_interval(image_size, roi_size, num_spatial_dims):
      assert (
          len(image_size) == num_spatial_dims
      ), "image coord different from spatial dims."
      assert (
          len(roi_size) == num_spatial_dims
      ), "roi coord different from spatial dims."
  
      scan_interval = [1 for _ in range(num_spatial_dims)]
      for i in range(num_spatial_dims):
          if roi_size[i] == image_size[i]:
              scan_interval[i] = int(roi_size[i])
          else:
              # this means that it's r-16 (if r>=64) and r*0.75 (if r<=64)
              scan_interval[i] = int(
                  max(roi_size[i] - 16, roi_size[i] * 0.75)
              )
      return tuple(scan_interval)
  
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 6 for calling a global function with example usage: _get_scan_interval(image_size, roi_size, num_spatial_dims) and returns: tuple