code: def saveMaskbyGrids(
      self,
      img_list: List[List[np.ndarray]],
      save_path: Union[str, None] = None,
      geoinfo: Union[Dict, None] = None,
  ) -> np.ndarray:
      if geoinfo is None:
          geoinfo = self.geoinfo
      raw_size = (geoinfo.ysize, geoinfo.xsize)
      h, w = self.grid_size
      row = math.ceil(raw_size[0] / h)
      col = math.ceil(raw_size[1] / w)
      result_1 = np.zeros((h * row, w * col), dtype=np.uint8)
      result_2 = result_1.copy()
      for i in range(row):
          for j in range(col):
              ih, iw = img_list[i][j].shape[:2]
              im = np.zeros(self.grid_size)
              im[:ih, :iw] = img_list[i][j]
              start_h = (
                  (i * h) if i == 0 else (i * (h - self.overlap[0]))
              )
              end_h = start_h + h
              start_w = (
                  (j * w) if j == 0 else (j * (w - self.overlap[1]))
              )
              end_w = start_w + w
              # 单区自己，重叠取或
              if (i + j) % 2 == 0:
                  result_1[start_h:end_h, start_w:end_w] = im
              else:
                  result_2[start_h:end_h, start_w:end_w] = im
      result = np.where(result_2 != 0, result_2, result_1)
      result = result[: raw_size[0], : raw_size[1]]
      if save_path is not None:
          self.saveMask(result, save_path, geoinfo)
      return result
  
imports: import os.path
  import numpy
  import cv2
  import math
  from typing import List, Dict, Tuple, Union
  from collections import defaultdict
  from easydict import EasyDict
  from .imgtools import sample_norm, two_percentLinear, get_thumbnail
label_desc: Use image node_id 10 for calling the Raster obj's underlying member method code with example usage: obj.saveMaskbyGrids(img_list, save_path, geoinfo) and returns: result