docstr: Open a `DICOM file` from path `fn` or bytes `fn` and load it as a `PIL Image`
docstr_tok: ["Open","a","`","DICOM","file","`","from","path","`","fn","`","or","bytes","`","fn","`","and","load","it","as","a","`","PIL","Image","`"]
code: def create(cls, fn: Path | str | bytes, mode=None) -> None:
      "Open a `DICOM file` from path `fn` or bytes `fn` and load it as a `PIL Image`"
      if isinstance(fn, bytes):
          im = Image.fromarray(
              pydicom.dcmread(
                  pydicom.filebase.DicomBytesIO(fn)
              ).pixel_array
          )
      if isinstance(fn, (Path, str)):
          im = Image.fromarray(pydicom.dcmread(fn).pixel_array)
      im.load()
      im = im._new(im.im)
      return cls(im.convert(mode) if mode else im)
  
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 1 for calling the PILDicom obj's underlying member method code with example usage: obj.create(cls, fn, mode) and returns: cls