class_docstr: Stores sorted anomaly scores of a single ground truth component.
  Used to efficiently compute the region overlap for many increasing thresholds.
docstr: Initialize the module.
  Args:
      anomaly_scores: List of all anomaly scores within the ground truth
                      component as numpy array.
code: def __init__(self, anomaly_scores):
      """
      Initialize the module.
      Args:
          anomaly_scores: List of all anomaly scores within the ground truth
                          component as numpy array.
      """
      # Keep a sorted list of all anomaly scores within the component.
      self.anomaly_scores = anomaly_scores.copy()
      self.anomaly_scores.sort()
  
      # Pointer to the anomaly score where the current threshold divides the component into OK / NOK pixels.
      self.index = 0
  
      # The last evaluated threshold.
      self.last_threshold = None
  
file_path: anomalib/tests/helpers/aupro_reference.py
imports: from bisect import bisect
  import numpy
  from scipy.ndimage.measurements import label
label_desc: Use image node_id 1 to create a new GroundTruthComponent object  with example: obj = GroundTruthComponent(anomaly_scores)