class_docstr: Analyzer to compute intensity histogram.
  
  Args:
      image_key: the key to find image data in the callable function input (data)
      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].
  
  Examples:
  
  .. code-block:: python
  
      import numpy as np
      from monai.auto3dseg.analyzer import ImageHistogram
  
      input = {}
      input['image'] = np.random.rand(1,30,30,30)
      input['label'] = np.ones([30,30,30])
      analyzer = ImageHistogram(image_key='image')
      print(analyzer(input))
class_docstr_tok: ["Analyzer","to","compute","intensity","histogram",".","Args",":","image_key",":","the","key","to","find","image","data","in","the","callable","function","input","(","data",")","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","]",".","Examples",":","..","code-block",":",":","python","import","numpy","as","np","from","monai.auto3dseg.analyzer","import","ImageHistogram","input","=","{","}","input","[","'image","'","]","=","np.random.rand","(","1,30,30,30",")","input","[","'label","'","]","=","np.ones","(","[","30,30,30","]",")","analyzer","=","ImageHistogram","(","image_key='image","'",")","print","(","analyzer","(","input",")",")"]
docstr: Callable to execute the pre-defined functions
  
  Returns:
      A dictionary. The dict has the key in self.report_format and value
  
  Raises:
      RuntimeError if the stats report generated is not consistent with the pre-
          defined report_format.
  
  Note:
      The stats operation uses numpy and torch to compute max, min, and other
      functions. If the input has nan/inf, the stats results will be nan/inf.
docstr_tok: ["Callable","to","execute","the","pre-defined","functions","Returns",":","A","dictionary",".","The","dict","has","the","key","in","self.report_format","and","value","Raises",":","RuntimeError","if","the","stats","report","generated","is","not","consistent","with","the","pre-","defined","report_format",".","Note",":","The","stats","operation","uses","numpy","and","torch","to","compute","max",",","min",",","and","other","functions",".","If","the","input","has","nan\/inf",",","the","stats","results","will","be","nan\/inf","."]
code: def __call__(self, data: dict) -> dict:
      """
      Callable to execute the pre-defined functions
  
      Returns:
          A dictionary. The dict has the key in self.report_format and value
  
      Raises:
          RuntimeError if the stats report generated is not consistent with the pre-
              defined report_format.
  
      Note:
          The stats operation uses numpy and torch to compute max, min, and other
          functions. If the input has nan/inf, the stats results will be nan/inf.
      """
  
      d = dict(data)
  
      ndas = convert_to_numpy(
          d[self.image_key], wrap_sequence=True
      )  # (1,H,W,D) or (C,H,W,D)
      nr_channels = np.shape(ndas)[0]
  
      # adjust histogram params to match channels
      if len(self.hist_bins) == 1:
          self.hist_bins = nr_channels * self.hist_bins
      if len(self.hist_bins) != nr_channels:
          raise ValueError(
              f"There is a mismatch between the number of channels ({nr_channels}) "
              f"and number histogram bins ({len(self.hist_bins)})."
          )
      if len(self.hist_range) == 1:
          self.hist_range = nr_channels * self.hist_range
      if len(self.hist_range) != nr_channels:
          raise ValueError(
              f"There is a mismatch between the number of channels ({nr_channels}) "
              f"and histogram ranges ({len(self.hist_range)})."
          )
  
      # perform calculation
      reports = []
      for channel in range(nr_channels):
          counts, bin_edges = np.histogram(
              ndas[channel, ...],
              bins=self.hist_bins[channel],
              range=(
                  self.hist_range[channel][0],
                  self.hist_range[channel][1],
              ),
          )
          _report = {
              "counts": counts.tolist(),
              "bin_edges": bin_edges.tolist(),
          }
          if not verify_report_format(
              _report, self.get_report_format()
          ):
              raise RuntimeError(
                  f"report generated by {self.__class__} differs from the report format."
              )
          reports.append(_report)
  
      d[self.stats_name] = reports
      return d
  
imports: from __future__ import annotations
  import time
  from abc import ABC, abstractmethod
  from collections.abc import Hashable, Mapping
  from copy import deepcopy
  from typing import Any
  import numpy
  import torch
  from monai.apps.utils import get_logger
  from monai.auto3dseg.operations import Operations, SampleOperations, SummaryOperations
  from monai.auto3dseg.utils import concat_multikeys_to_dict, concat_val_to_np, get_foreground_image, get_foreground_label, get_label_ccp, verify_report_format
  from monai.bundle.config_parser import ConfigParser
  from monai.bundle.utils import ID_SEP_KEY
  from monai.data import MetaTensor, affine_to_spacing
  from monai.transforms.transform import MapTransform
  from monai.transforms.utils_pytorch_numpy_unification import sum, unique
  from monai.utils import convert_to_numpy
  from monai.utils.enums import DataStatsKeys, ImageStatsKeys, LabelStatsKeys
  from monai.utils.misc import ImageMetaKey, label_union
label_desc: Use image node_id 2 for calling the ImageHistogram obj's underlying member method code with example usage: obj.__call__(data) and returns: d