code: def compute_froc_curve_data(
      fp_probs: np.ndarray | torch.Tensor,
      tp_probs: np.ndarray | torch.Tensor,
      num_targets: int,
      num_images: int,
  ) -> tuple[np.ndarray, np.ndarray]:
      """
      This function is modified from the official evaluation code of
      `CAMELYON 16 Challenge <https://camelyon16.grand-challenge.org/>`_, and used to compute
      the required data for plotting the Free Response Operating Characteristic (FROC) curve.
  
      Args:
          fp_probs: an array that contains the probabilities of the false positive detections for all
              images under evaluation.
          tp_probs: an array that contains the probabilities of the True positive detections for all
              images under evaluation.
          num_targets: the total number of targets (excluding `labels_to_exclude`) for all images under evaluation.
          num_images: the number of images under evaluation.
  
      """
      if not isinstance(fp_probs, type(tp_probs)):
          raise AssertionError("fp and tp probs should have same type.")
      if isinstance(fp_probs, torch.Tensor):
          fp_probs = fp_probs.detach().cpu().numpy()
      if isinstance(tp_probs, torch.Tensor):
          tp_probs = tp_probs.detach().cpu().numpy()
  
      total_fps, total_tps = [], []
      all_probs = sorted(set(list(fp_probs) + list(tp_probs)))
      for thresh in all_probs[1:]:
          total_fps.append((fp_probs >= thresh).sum())
          total_tps.append((tp_probs >= thresh).sum())
      total_fps.append(0)
      total_tps.append(0)
      fps_per_image = np.asarray(total_fps) / float(num_images)
      total_sensitivity = np.asarray(total_tps) / float(num_targets)
      return fps_per_image, total_sensitivity
  
file_path: MONAI/monai/metrics/froc.py
imports: from __future__ import annotations
  from typing import Any, cast
  import numpy
  import torch
  from monai.config import NdarrayOrTensor
label_desc: Use image node_id 3 for calling a global function with example usage: compute_froc_curve_data(fp_probs, tp_probs, num_targets, num_images) and returns: fps_per_image,  total_sensitivity