class_docstr: Handler of MetricsReloadedBinary, which wraps the binary pairwise metrics of MetricsReloaded.
class_docstr_tok: ["Handler","of","MetricsReloadedBinary",",","which","wraps","the","binary","pairwise","metrics","of","MetricsReloaded","."]
docstr: Args:
      metric_name: Name of a binary metric from the MetricsReloaded package.
      include_background: whether to include computation on the first channel of
          the predicted output. Defaults to ``True``.
      reduction: define mode of reduction to the metrics, will only apply reduction on `not-nan` values,
          available reduction modes: {``"none"``, ``"mean"``, ``"sum"``, ``"mean_batch"``, ``"sum_batch"``,
          ``"mean_channel"``, ``"sum_channel"``}, default to ``"mean"``. if "none", will not do reduction.
      get_not_nans: whether to return the `not_nans` count, if True, aggregate() returns (metric, not_nans).
          Here `not_nans` count the number of not nans for the metric,
          thus its shape equals to the shape of the metric.
      output_transform: callable to extract `y_pred` and `y` from `ignite.engine.state.output` then
          construct `(y_pred, y)` pair, where `y_pred` and `y` can be `batch-first` Tensors or
          lists of `channel-first` Tensors. the form of `(y_pred, y)` is required by the `update()`.
          `engine.state` and `output_transform` inherit from the ignite concept:
          https://pytorch.org/ignite/concepts.html#state, explanation and usage example are in the tutorial:
          https://github.com/Project-MONAI/tutorials/blob/master/modules/batch_output_transform.ipynb.
      save_details: whether to save metric computation details per image, for example: TP/TN/FP/FN of every image.
          default to True, will save to `engine.state.metric_details` dict with the metric name as key.
  
  See also:
      :py:meth:`monai.metrics.wrapper`
docstr_tok: ["Args",":","metric_name",":","Name","of","a","binary","metric","from","the","MetricsReloaded","package",".","include_background",":","whether","to","include","computation","on","the","first","channel","of","the","predicted","output",".","Defaults","to","``","True","``",".","reduction",":","define","mode","of","reduction","to","the","metrics",",","will","only","apply","reduction","on","`","not-nan","`","values",",","available","reduction","modes",":","{","``","``","none","''","``",",","``","``","mean","''","``",",","``","``","sum","''","``",",","``","``","mean_batch","''","``",",","``","``","sum_batch","''","``",",","``","``","mean_channel","''","``",",","``","``","sum_channel","''","``","}",",","default","to","``","``","mean","''","``",".","if","``","none","''",",","will","not","do","reduction",".","get_not_nans",":","whether","to","return","the","`","not_nans","`","count",",","if","True",",","aggregate","(",")","returns","(","metric",",","not_nans",")",".","Here","`","not_nans","`","count","the","number","of","not","nans","for","the","metric",",","thus","its","shape","equals","to","the","shape","of","the","metric",".","output_transform",":","callable","to","extract","`","y_pred","`","and","`","y","`","from","`","ignite.engine.state.output","`","then","construct","`","(","y_pred",",","y",")","`","pair",",","where","`","y_pred","`","and","`","y","`","can","be","`","batch-first","`","Tensors","or","lists","of","`","channel-first","`","Tensors",".","the","form","of","`","(","y_pred",",","y",")","`","is","required","by","the","`","update","(",")","`",".","`","engine.state","`","and","`","output_transform","`","inherit","from","the","ignite","concept",":","https",":","\/\/pytorch.org\/ignite\/concepts.html","#","state",",","explanation","and","usage","example","are","in","the","tutorial",":","https",":","\/\/github.com\/Project-MONAI\/tutorials\/blob\/master\/modules\/batch_output_transform.ipynb",".","save_details",":","whether","to","save","metric","computation","details","per","image",",","for","example",":","TP\/TN\/FP\/FN","of","every","image",".","default","to","True",",","will","save","to","`","engine.state.metric_details","`","dict","with","the","metric","name","as","key",".","See","also",":",":","py",":","meth",":","`","monai.metrics.wrapper","`"]
code: def __init__(
      self,
      metric_name: str,
      include_background: bool = True,
      reduction: MetricReduction | str = MetricReduction.MEAN,
      get_not_nans: bool = False,
      output_transform: Callable = lambda x: x,
      save_details: bool = True,
  ) -> None:
      """
  
      Args:
          metric_name: Name of a binary metric from the MetricsReloaded package.
          include_background: whether to include computation on the first channel of
              the predicted output. Defaults to ``True``.
          reduction: define mode of reduction to the metrics, will only apply reduction on `not-nan` values,
              available reduction modes: {``"none"``, ``"mean"``, ``"sum"``, ``"mean_batch"``, ``"sum_batch"``,
              ``"mean_channel"``, ``"sum_channel"``}, default to ``"mean"``. if "none", will not do reduction.
          get_not_nans: whether to return the `not_nans` count, if True, aggregate() returns (metric, not_nans).
              Here `not_nans` count the number of not nans for the metric,
              thus its shape equals to the shape of the metric.
          output_transform: callable to extract `y_pred` and `y` from `ignite.engine.state.output` then
              construct `(y_pred, y)` pair, where `y_pred` and `y` can be `batch-first` Tensors or
              lists of `channel-first` Tensors. the form of `(y_pred, y)` is required by the `update()`.
              `engine.state` and `output_transform` inherit from the ignite concept:
              https://pytorch.org/ignite/concepts.html#state, explanation and usage example are in the tutorial:
              https://github.com/Project-MONAI/tutorials/blob/master/modules/batch_output_transform.ipynb.
          save_details: whether to save metric computation details per image, for example: TP/TN/FP/FN of every image.
              default to True, will save to `engine.state.metric_details` dict with the metric name as key.
  
      See also:
          :py:meth:`monai.metrics.wrapper`
      """
      metric_fn = MetricsReloadedBinary(
          metric_name=metric_name,
          include_background=include_background,
          reduction=reduction,
          get_not_nans=get_not_nans,
      )
      super().__init__(
          metric_fn=metric_fn,
          output_transform=output_transform,
          save_details=save_details,
      )
  
file_path: MONAI/monai/handlers/metrics_reloaded_handler.py
imports: from __future__ import annotations
  from collections.abc import Callable
  from monai.handlers.ignite_metric import IgniteMetricHandler
  from monai.metrics import MetricsReloadedBinary, MetricsReloadedCategorical
  from monai.utils.enums import MetricReduction
label_desc: Use image node_id 1 to create a new MetricsReloadedBinaryHandler object from inherited base classes: IgniteMetricHandler with example: obj = MetricsReloadedBinaryHandler(metric_name, include_background, reduction, get_not_nans, output_transform, save_details)