code: def saveMask(
      self,
      img: np.array,
      save_path: str,
      geoinfo: Union[Dict, None] = None,
      count: int = 1,
  ) -> None:
      if geoinfo is None:
          geoinfo = self.geoinfo
      new_meta = self.src_data.meta.copy()
      new_meta.update(
          {
              "driver": "GTiff",
              "width": geoinfo.xsize,
              "height": geoinfo.ysize,
              "count": count,
              "dtype": geoinfo.dtype,
              "crs": geoinfo.crs,
              "transform": geoinfo.geotf[:6],
              "nodata": 0,
          }
      )
      img = np.nan_to_num(img).astype("int16")
      with rasterio.open(save_path, "w", **new_meta) as tf:
          if count == 1:
              tf.write(img, indexes=1)
          else:
              for i in range(count):
                  tf.write(img[:, :, i], indexes=(i + 1))
  
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 9 for calling the Raster obj's underlying member method code with example usage: obj.saveMask(img, save_path, geoinfo, count) without return types