code: def compute_fp_tp_probs_nd(
      probs: NdarrayOrTensor,
      coords: NdarrayOrTensor,
      evaluation_mask: NdarrayOrTensor,
      labels_to_exclude: list | None = None,
  ) -> tuple[NdarrayOrTensor, NdarrayOrTensor, int]:
      """
      This function is modified from the official evaluation code of
      `CAMELYON 16 Challenge <https://camelyon16.grand-challenge.org/>`_, and used to distinguish
      true positive and false positive predictions. A true positive prediction is defined when
      the detection point is within the annotated ground truth region.
  
      Args:
          probs: an array with shape (n,) that represents the probabilities of the detections.
              Where, n is the number of predicted detections.
          coords: an array with shape (n, n_dim) that represents the coordinates of the detections.
              The dimensions must be in the same order as in `evaluation_mask`.
          evaluation_mask: the ground truth mask for evaluation.
          labels_to_exclude: labels in this list will not be counted for metric calculation.
  
      Returns:
          fp_probs: an array that contains the probabilities of the false positive detections.
          tp_probs: an array that contains the probabilities of the True positive detections.
          num_targets: the total number of targets (excluding `labels_to_exclude`) for all images under evaluation.
  
      """
      if not (len(probs) == len(coords)):
          raise ValueError(
              f"the length of probs {probs.shape}, should be the same as of coords {coords.shape}."
          )
      if not (
          len(coords.shape) > 1
          and coords.shape[1] == len(evaluation_mask.shape)
      ):
          raise ValueError(
              f"coords {coords.shape} need to represent the same number of dimensions as mask {evaluation_mask.shape}."
          )
  
      if isinstance(probs, torch.Tensor):
          probs = probs.detach().cpu().numpy()
      if isinstance(coords, torch.Tensor):
          coords = coords.detach().cpu().numpy()
      if isinstance(evaluation_mask, torch.Tensor):
          evaluation_mask = evaluation_mask.detach().cpu().numpy()
  
      if labels_to_exclude is None:
          labels_to_exclude = []
  
      max_label = np.max(evaluation_mask)
      tp_probs = np.zeros((max_label,), dtype=np.float32)
  
      hittedlabel = evaluation_mask[tuple(coords.T)]
      fp_probs = probs[np.where(hittedlabel == 0)]
      for i in range(1, max_label + 1):
          if i not in labels_to_exclude and i in hittedlabel:
              tp_probs[i - 1] = probs[np.where(hittedlabel == i)].max()
  
      num_targets = max_label - len(labels_to_exclude)
      return fp_probs, tp_probs, cast(int, num_targets)
  
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 1 for calling a global function with example usage: compute_fp_tp_probs_nd(probs, coords, evaluation_mask, labels_to_exclude) and returns: fp_probs,  tp_probs,  cast