class_docstr: Helper class that compiles multiple images into a grid using subplots.
  
  Individual images can be added with the `add_image` method. When all images have been added, the `generate` method
  must be called to compile the image grid and obtain the final visualization.
docstr: Add an image to the grid.
  
  Args:
    image (np.ndarray): Image which should be added to the figure.
    title (str): Image title shown on the plot.
    color_map (str | None): Name of matplotlib color map used to map scalar data to colours. Defaults to None.
docstr_tok: ["Add","an","image","to","the","grid",".","Args",":","image","(","np.ndarray",")",":","Image","which","should","be","added","to","the","figure",".","title","(","str",")",":","Image","title","shown","on","the","plot",".","color_map","(","str","|","None",")",":","Name","of","matplotlib","color","map","used","to","map","scalar","data","to","colours",".","Defaults","to","None","."]
code: def add_image(
      self,
      image: np.ndarray,
      title: str | None = None,
      color_map: str | None = None,
  ) -> None:
      """Add an image to the grid.
  
      Args:
        image (np.ndarray): Image which should be added to the figure.
        title (str): Image title shown on the plot.
        color_map (str | None): Name of matplotlib color map used to map scalar data to colours. Defaults to None.
      """
      image_data = dict(image=image, title=title, color_map=color_map)
      self.images.append(image_data)
  
imports: from __future__ import annotations
  from dataclasses import dataclass, field
  from enum import Enum
  from pathlib import Path
  from typing import Iterator
  import cv2
  import matplotlib.figure
  import matplotlib.pyplot
  import numpy
  from skimage.segmentation import mark_boundaries
  from anomalib.data import TaskType
  from anomalib.data.utils import read_image
  from anomalib.post_processing.post_process import add_anomalous_label, add_normal_label, draw_boxes, superimpose_anomaly_map
label_desc: Use image node_id 2 for calling the ImageGrid obj's underlying member method code with example usage: obj.add_image(image, title, color_map) without return types