class_docstr: SegSummarizer serializes the operations for data analysis in Auto3Dseg pipeline. It loads
  two types of analyzer functions and execute differently. The first type of analyzer is
  CaseAnalyzer which is similar to traditional monai transforms. It can be composed with other
  transforms to process the data dict which has image/label keys. The second type of analyzer
  is SummaryAnalyzer which works only on a list of dictionary. Each dictionary is the output
  of the case analyzers on a single dataset.
  
  Args:
      image_key: a string that user specify for the image. The DataAnalyzer will look it up in the
          datalist to locate the image files of the dataset.
      label_key: a string that user specify for the label. The DataAnalyzer will look it up in the
          datalist to locate the label files of the dataset. If label_key is None, the DataAnalyzer
          will skip looking for labels and all label-related operations.
      do_ccp: apply the connected component algorithm to process the labels/images.
      hist_bins: list of positive integers (one for each channel) for setting the number of bins used to
          compute the histogram. Defaults to [100].
      hist_range: list of lists of two floats (one for each channel) setting the intensity range to
          compute the histogram. Defaults to [-500, 500].
      histogram_only: whether to only compute histograms. Defaults to False.
  
  Examples:
      .. code-block:: python
  
          # imports
  
          summarizer = SegSummarizer("image", "label")
          transform_list = [
              LoadImaged(keys=keys),
              EnsureChannelFirstd(keys=keys),  # this creates label to be (1,H,W,D)
              ToDeviced(keys=keys, device=device, non_blocking=True),
              Orientationd(keys=keys, axcodes="RAS"),
              EnsureTyped(keys=keys, data_type="tensor"),
              Lambdad(keys="label", func=lambda x: torch.argmax(x, dim=0, keepdim=True) if x.shape[0] > 1 else x),
              SqueezeDimd(keys=["label"], dim=0),
              summarizer,
          ]
          ...
          # skip some steps to set up data loader
          dataset = data.DataLoader(ds, batch_size=1, shuffle=False, num_workers=n_workers, collate_fn=no_collation)
          transform = Compose(transform_list)
          stats = []
          for batch_data in dataset:
              d = transform(batch_data[0])
              stats.append(d)
          report = summarizer.summarize(stats)
code: def __init__(
      self,
      image_key: str,
      label_key: str | None,
      average: bool = True,
      do_ccp: bool = True,
      hist_bins: list[int] | int | None = None,
      hist_range: list | None = None,
      histogram_only: bool = False,
  ) -> None:
      self.image_key = image_key
      self.label_key = label_key
      # set defaults
      self.hist_bins: list[int] | int = (
          [100] if hist_bins is None else hist_bins
      )
      self.hist_range: list = (
          [-500, 500] if hist_range is None else hist_range
      )
      self.histogram_only = histogram_only
  
      self.summary_analyzers: list[Any] = []
      super().__init__()
  
      self.add_analyzer(
          FilenameStats(image_key, DataStatsKeys.BY_CASE_IMAGE_PATH),
          None,
      )
      self.add_analyzer(
          FilenameStats(label_key, DataStatsKeys.BY_CASE_LABEL_PATH),
          None,
      )
      if not self.histogram_only:
          self.add_analyzer(
              ImageStats(image_key), ImageStatsSumm(average=average)
          )
  
          if label_key is None:
              return
  
          self.add_analyzer(
              FgImageStats(image_key, label_key),
              FgImageStatsSumm(average=average),
          )
  
          self.add_analyzer(
              LabelStats(image_key, label_key, do_ccp=do_ccp),
              LabelStatsSumm(average=average, do_ccp=do_ccp),
          )
  
      # compute histograms
      if self.hist_bins != 0:
          self.add_analyzer(
              ImageHistogram(
                  image_key=image_key,
                  hist_bins=hist_bins,
                  hist_range=hist_range,
              ),
              ImageHistogramSumm(),
          )
  
file_path: MONAI/monai/auto3dseg/seg_summarizer.py
imports: from __future__ import annotations
  from typing import Any
  from monai.auto3dseg.analyzer import Analyzer, FgImageStats, FgImageStatsSumm, FilenameStats, ImageHistogram, ImageHistogramSumm, ImageStats, ImageStatsSumm, LabelStats, LabelStatsSumm
  from monai.transforms import Compose
  from monai.utils.enums import DataStatsKeys
label_desc: Use image node_id 1 to create a new SegSummarizer object from inherited base classes: Compose with example: obj = SegSummarizer(image_key, label_key, average, do_ccp, hist_bins, hist_range, histogram_only)