code: def as_dict(
      self: DcmDataset, px_summ=True, window=dicom_windows.brain
  ):
      "Convert the header of a dicom into a dictionary"
      pxdata = (0x7FE0, 0x0010)
      vals = [self[o] for o in self.keys() if o != pxdata]
      res = _split_elem(vals)
      res["fname"] = self.filename
      if not px_summ:
          return res
      stats = "min", "max", "mean", "std"
      try:
          pxs = self.pixel_array
          for f in stats:
              res["img_" + f] = getattr(pxs, f)()
          res["img_pct_window"] = self.pct_in_window(*window)
      except Exception as e:
          for f in stats:
              res["img_" + f] = 0
          print(res, e)
      return res
  
imports: from __future__ import annotations
  from ..basics import *
  from ..vision.all import *
  from ..data.transforms import *
  import pydicom, kornia, skimage
  from pydicom.dataset import Dataset
  from pydicom.tag import BaseTag
  from pydicom.multival import MultiValue
  from PIL import Image
label_desc: Use image node_id 37 for calling a global function with example usage: as_dict(px_summ, window) and returns: res, res