code: def save_tif16(
      x: Tensor | DcmDataset, path, bins=None, compress=True
  ):
      "Save tensor or dicom image into `tiff` format"
      fn = Path(path).with_suffix(".tif")
      Image.fromarray(x.to_uint16(bins)).save(
          str(fn), compression="tiff_deflate" if compress else None
      )
  
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 30 for calling a global function with example usage: save_tif16(x, path, bins, compress) without return types