class_docstr: Base class for defining MetricsReloaded metrics as a CumulativeIterationMetric.
  
  Args:
      metric_name: Name of a 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.
class_docstr_tok: ["Base","class","for","defining","MetricsReloaded","metrics","as","a","CumulativeIterationMetric",".","Args",":","metric_name",":","Name","of","a","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","."]
code: def aggregate(
      self, reduction: MetricReduction | str | None = None
  ) -> torch.Tensor | tuple[torch.Tensor, torch.Tensor]:
      data = self.get_buffer()
      if not isinstance(data, torch.Tensor):
          raise ValueError(
              "the data to aggregate must be PyTorch Tensor."
          )
      # do metric reduction
      f, not_nans = do_metric_reduction(
          data, reduction or self.reduction
      )
      return (f, not_nans) if self.get_not_nans else f
  
file_path: MONAI/monai/metrics/wrapper.py
imports: from __future__ import annotations
  from typing import cast
  import torch
  from monai.metrics.utils import do_metric_reduction, ignore_background
  from monai.utils import MetricReduction, convert_to_numpy, convert_to_tensor, optional_import
  from .metric import CumulativeIterationMetric
label_desc: Use image node_id 2 for calling the MetricsReloadedWrapper obj's underlying member method code with example usage: obj.aggregate(reduction) and returns: unknown