code: def _get_scan_interval(
      image_size: Sequence[int],
      roi_size: Sequence[int],
      num_spatial_dims: int,
      overlap: Sequence[float],
  ) -> tuple[int, ...]:
      """
      Compute scan interval according to the image size, roi size and overlap.
      Scan interval will be `int((1 - overlap) * roi_size)`, if interval is 0,
      use 1 instead to make sure sliding window works.
  
      """
      if len(image_size) != num_spatial_dims:
          raise ValueError(
              f"len(image_size) {len(image_size)} different from spatial dims {num_spatial_dims}."
          )
      if len(roi_size) != num_spatial_dims:
          raise ValueError(
              f"len(roi_size) {len(roi_size)} different from spatial dims {num_spatial_dims}."
          )
  
      scan_interval = []
      for i, o in zip(range(num_spatial_dims), overlap):
          if roi_size[i] == image_size[i]:
              scan_interval.append(int(roi_size[i]))
          else:
              interval = int(roi_size[i] * (1 - o))
              scan_interval.append(interval if interval > 0 else 1)
      return tuple(scan_interval)
  
file_path: MONAI/monai/inferers/utils.py
imports: from __future__ import annotations
  import itertools
  from collections.abc import Callable, Mapping, Sequence
  from typing import Any, Iterable
  import numpy
  import torch
  import torch.nn.functional
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import compute_importance_map, dense_patch_slices, get_valid_patch_size
  from monai.utils import BlendMode, PytorchPadMode, convert_data_type, convert_to_dst_type, ensure_tuple, ensure_tuple_rep, fall_back_tuple, look_up_option, optional_import, pytorch_after
label_desc: Use image node_id 4 for calling a global function with example usage: _get_scan_interval(image_size, roi_size, num_spatial_dims, overlap) and returns: tuple