code: def anomaly_map_to_color_map(
      anomaly_map: np.ndarray, normalize: bool = True
  ) -> np.ndarray:
      """Compute anomaly color heatmap.
  
      Args:
          anomaly_map (np.ndarray): Final anomaly map computed by the distance metric.
          normalize (bool, optional): Bool to normalize the anomaly map prior to applying
              the color map. Defaults to True.
  
      Returns:
          np.ndarray: [description]
      """
      if normalize:
          anomaly_map = (anomaly_map - anomaly_map.min()) / np.ptp(
              anomaly_map
          )
      anomaly_map = anomaly_map * 255
      anomaly_map = anomaly_map.astype(np.uint8)
  
      anomaly_map = cv2.applyColorMap(anomaly_map, cv2.COLORMAP_JET)
      anomaly_map = cv2.cvtColor(anomaly_map, cv2.COLOR_BGR2RGB)
      return anomaly_map
  
file_path: anomalib/src/anomalib/post_processing/post_process.py
imports: from __future__ import annotations
  import math
  from enum import Enum
  import cv2
  import numpy
  from skimage import morphology
label_desc: Use image node_id 4 for calling a global function with example usage: anomaly_map_to_color_map(anomaly_map, normalize) and returns: anomaly_map