# tfio.image.decode_dicom_data

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/ops/dicom_ops.py#L94-L132) |

Getting DICOM Tag Data.

    tfio.image.decode_dicom_data(
        contents, tags=None, name=None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Decode DICOM files for medical imaging](https://www.tensorflow.org/io/tutorials/dicom) |

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`](https://www.tensorflow.org/io/api_docs/python/tfio/image/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          = {<a href="https://doi.org/10.5281/zenodo.3337331">https://doi.org/10.5281/zenodo.3337331</a>}
    }

<br />

<br />

<br />

| ## Args ||
|---|---|
| `contents` | A Tensor of type string. 0-D. The byte string encoded DICOM file. |
| `tags` | A Tensor of type [`tf.uint32`](https://www.tensorflow.org/api_docs/python/tf#uint32) of any dimension. These `uint32` numbers map directly to DICOM tags. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string) and same shape as `tags`. If a dicom tag is a list of strings, they are combined into one string and seperated by a double backslash \`\`. There is a bug in [DCMTK](https://support.dcmtk.org/docs/) if the tag is a list of numbers, only the zeroth element will be returned as a string. ||

<br />