class_docstr: This class provides a way to calculate a reasonable output voxel spacing according to
  the input dataset. The achieved values can used to resample the input in 3d segmentation tasks
  (like using as the `pixdim` parameter in `monai.transforms.Spacingd`).
  In addition, it also supports to compute the mean, std, min and max intensities of the input,
  and these statistics are helpful for image normalization
  (as parameters of `monai.transforms.ScaleIntensityRanged` and `monai.transforms.NormalizeIntensityd`).
  
  The algorithm for calculation refers to:
  `Automated Design of Deep Learning Methods for Biomedical Image Segmentation <https://arxiv.org/abs/1904.08128>`_.
class_docstr_tok: ["This","class","provides","a","way","to","calculate","a","reasonable","output","voxel","spacing","according","to","the","input","dataset",".","The","achieved","values","can","used","to","resample","the","input","in","3d","segmentation","tasks","(","like","using","as","the","`","pixdim","`","parameter","in","`","monai.transforms.Spacingd","`",")",".","In","addition",",","it","also","supports","to","compute","the","mean",",","std",",","min","and","max","intensities","of","the","input",",","and","these","statistics","are","helpful","for","image","normalization","(","as","parameters","of","`","monai.transforms.ScaleIntensityRanged","`","and","`","monai.transforms.NormalizeIntensityd","`",")",".","The","algorithm","for","calculation","refers","to",":","`","Automated","Design","of","Deep","Learning","Methods","for","Biomedical","Image","Segmentation","<","https",":","\/\/arxiv.org\/abs\/1904.08128",">","`","_","."]
docstr: Args:
      dataset: dataset from which to load the data.
      image_key: key name of images (default: ``image``).
      label_key: key name of labels (default: ``label``).
      meta_key: explicitly indicate the key of the corresponding metadata dictionary.
          for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
          the metadata is a dictionary object which contains: filename, affine, original_shape, etc.
          if None, will try to construct meta_keys by `{image_key}_{meta_key_postfix}`.
          This is not required if `data[image_key]` is a MetaTensor.
      meta_key_postfix: use `{image_key}_{meta_key_postfix}` to fetch the metadata from dict,
          the metadata is a dictionary object (default: ``meta_dict``).
      num_workers: how many subprocesses to use for data loading.
          ``0`` means that the data will be loaded in the main process (default: ``0``).
      kwargs: other parameters (except `batch_size` and `num_workers`) for DataLoader,
          this class forces to use ``batch_size=1``.
docstr_tok: ["Args",":","dataset",":","dataset","from","which","to","load","the","data",".","image_key",":","key","name","of","images","(","default",":","``","image","``",")",".","label_key",":","key","name","of","labels","(","default",":","``","label","``",")",".","meta_key",":","explicitly","indicate","the","key","of","the","corresponding","metadata","dictionary",".","for","example",",","for","data","with","key","`","image","`",",","the","metadata","by","default","is","in","`","image_meta_dict","`",".","the","metadata","is","a","dictionary","object","which","contains",":","filename",",","affine",",","original_shape",",","etc",".","if","None",",","will","try","to","construct","meta_keys","by","`","{","image_key","}","_","{","meta_key_postfix","}","`",".","This","is","not","required","if","`","data","[","image_key","]","`","is","a","MetaTensor",".","meta_key_postfix",":","use","`","{","image_key","}","_","{","meta_key_postfix","}","`","to","fetch","the","metadata","from","dict",",","the","metadata","is","a","dictionary","object","(","default",":","``","meta_dict","``",")",".","num_workers",":","how","many","subprocesses","to","use","for","data","loading",".","``","0","``","means","that","the","data","will","be","loaded","in","the","main","process","(","default",":","``","0","``",")",".","kwargs",":","other","parameters","(","except","`","batch_size","`","and","`","num_workers","`",")","for","DataLoader",",","this","class","forces","to","use","``","batch_size=1","``","."]
code: def __init__(
      self,
      dataset: Dataset,
      image_key: str | None = "image",
      label_key: str | None = "label",
      meta_key: KeysCollection | None = None,
      meta_key_postfix: str = DEFAULT_POST_FIX,
      num_workers: int = 0,
      **kwargs,
  ):
      """
      Args:
          dataset: dataset from which to load the data.
          image_key: key name of images (default: ``image``).
          label_key: key name of labels (default: ``label``).
          meta_key: explicitly indicate the key of the corresponding metadata dictionary.
              for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
              the metadata is a dictionary object which contains: filename, affine, original_shape, etc.
              if None, will try to construct meta_keys by `{image_key}_{meta_key_postfix}`.
              This is not required if `data[image_key]` is a MetaTensor.
          meta_key_postfix: use `{image_key}_{meta_key_postfix}` to fetch the metadata from dict,
              the metadata is a dictionary object (default: ``meta_dict``).
          num_workers: how many subprocesses to use for data loading.
              ``0`` means that the data will be loaded in the main process (default: ``0``).
          kwargs: other parameters (except `batch_size` and `num_workers`) for DataLoader,
              this class forces to use ``batch_size=1``.
  
      """
  
      self.data_loader = DataLoader(
          dataset=dataset,
          batch_size=1,
          num_workers=num_workers,
          **kwargs,
      )
  
      self.image_key = image_key
      self.label_key = label_key
      self.meta_key = meta_key or f"{image_key}_{meta_key_postfix}"
      self.all_meta_data: list = []
  
file_path: MONAI/monai/data/dataset_summary.py
imports: from __future__ import annotations
  import warnings
  from itertools import chain
  import numpy
  import torch
  from monai.config import KeysCollection
  from monai.data.dataloader import DataLoader
  from monai.data.dataset import Dataset
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import affine_to_spacing
  from monai.transforms import concatenate
  from monai.utils import PostFix, convert_data_type, convert_to_tensor
label_desc: Use image node_id 1 to create a new DatasetSummary object  with example: obj = DatasetSummary(dataset, image_key, label_key, meta_key, meta_key_postfix, num_workers)