code: def save_grayscale(image, output_dir, output_name):
      """
      Save a 3D Numpy array (H, W, 1) as an image.
  
      Args:
          image (numpy.ndarray): Image to save
          output_dir (str): Output directory
          output_name (str): Output name
      """
      Path.mkdir(Path(output_dir), parents=True, exist_ok=True)
  
      cv2.imwrite(str(Path(output_dir) / output_name), image)
  
imports: from pathlib import Path
  import cv2
label_desc: Use image node_id 1 for calling a global function with example usage: save_grayscale(image, output_dir, output_name) without return types