code: def cut_region(self, x, y, radius, data):
          
          n = radius
          ht, wd = data.shape
          x0, x1 = max(0, x - n), min(wd - 1, x + n)
          y0, y1 = max(0, y - n), min(ht - 1, y + n)
          arr = data[y0:y1 + 1, x0:x1 + 1]
          return (x0, y0, arr)
docs: Return a cut region (radius) pixels away from (x, y) in (data).