code: def get_slice(image, roi_shape=(128, 128, 128), overlap_factor=0.5):
      assert len(roi_shape) == 3 and any(roi_shape)
      assert 0 < overlap_factor < 1
      image_shape, dim = list(image.shape[2:]), len(image.shape[2:])
      strides = [
          int(roi_shape[i] * (1 - overlap_factor)) for i in range(dim)
      ]
      size = [
          (image_shape[i] - roi_shape[i]) // strides[i] + 1
          for i in range(dim)
      ]
      for i in range(0, strides[0] * size[0], strides[0]):
          for j in range(0, strides[1] * size[1], strides[1]):
              for k in range(0, strides[2] * size[2], strides[2]):
                  yield i, j, k
  
file_path: tinygrad/examples/mlperf/helpers.py
imports: from collections import OrderedDict
  import unicodedata
  import numpy
  from scipy import signal
label_desc: Use image node_id 3 for calling a global function with example usage: get_slice(image, roi_shape, overlap_factor) without return types