code: def decode_dicom_image(
      contents,
      color_dim=False,
      on_error="skip",
      scale="preserve",
      dtype=tf.uint16,
      name=None,
  ):
      """Getting DICOM Image Data.
  
      This package has two operations which wrap `DCMTK` functions.
      `decode_dicom_image` decodes the pixel data from DICOM files, and
      `decode_dicom_data` decodes tag information.
      `dicom_tags` contains useful DICOM tags such as `dicom_tags.PatientsName`.
      We borrow the same tag notation from the
      [`pydicom`](https://pydicom.github.io/) dicom package.
  
      The detailed usage of DICOM is available in
      [tutorial](https://www.tensorflow.org/io/tutorials/dicom).
  
      If this package helped, please kindly cite the below:
      ```
      @misc{marcelo_lerendegui_2019_3337331,
          author       = {Marcelo Lerendegui and Ouwen Huang},
          title        = {Tensorflow Dicom Decoder},
          month        = jul,
          year         = 2019,
          doi          = {10.5281/zenodo.3337331},
          url          = {https://doi.org/10.5281/zenodo.3337331}
      }
      ```
  
      Args:
          contents: A Tensor of type string. 0-D. The byte string encoded DICOM file.
          color_dim: An optional `bool`. Defaults to `False`. If `True`, a third
          channel will be appended to all images forming a 3-D tensor.
          A 1024 x 1024 grayscale image will be 1024 x 1024 x 1.
          on_error: Defaults to `skip`. This attribute establishes the behavior in
          case an error occurs on opening the image or if the output type cannot
          accomodate all the possible input values. For example if the user sets
          the output dtype to `tf.uint8`, but a dicom image stores a `tf.uint16`
          type. `strict` throws an error. `skip` returns a 1-D empty tensor.
          `lossy` continues with the operation scaling the value via the `scale`
          attribute.
          scale:  Defaults to `preserve`. This attribute establishes what to do with
          the scale of the input values. `auto` will autoscale the input values,
          if the output type is integer, `auto` will use the maximum output scale
          for example a `uint8` which stores values from [0, 255] can be linearly
          stretched to fill a `uint16` that is [0,65535]. If the output is float,
          `auto` will scale to [0,1]. `preserve` keeps the values as they are, an
          input value greater than the maximum possible output will be clipped.
          dtype: An optional `tf.DType` from: `tf.uint8`, `tf.uint16`, `tf.uint32`,
          `tf.uint64`, `tf.float16`, `tf.float32`, `tf.float64`. Defaults to
          `tf.uint16`.
          name: A name for the operation (optional).
  
      Returns:
          A `Tensor` of type `dtype` and the shape is determined by the DICOM file.
      """
      return core_ops.io_decode_dicom_image(
          contents=contents,
          color_dim=color_dim,
          on_error=on_error,
          scale=scale,
          dtype=dtype,
          name=name,
      )
  
imports: import numpy
  import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 1 for calling a global function with example usage: decode_dicom_image(contents, color_dim, on_error, scale, dtype, name) and returns: core_ops