:orphan:

.. _general_examples:

General examples
----------------

Somewhere to start

.. raw:: html

.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This examples illustrates how to find the differences between two DICOM files.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_dicom_difference_thumb.png
    :alt:

  :doc:`/auto_examples/plot_dicom_difference`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Analyse differences between DICOM files</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Very simple app to display unicode person names.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_show_charset_name_thumb.png
    :alt:

  :doc:`/auto_examples/show_charset_name`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Display unicode person names</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a dicom file using hierarchical tree">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_dicomtree_thumb.png
    :alt:

  :doc:`/auto_examples/dicomtree`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Show a dicom file using hierarchical tree</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show how to write a DICOM dataset into a byte array and to read it back from a byte array. This can be helpful for example if working with datasets saved as blobs in a database.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_memory_dataset_thumb.png
    :alt:

  :doc:`/auto_examples/memory_dataset`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Show working with memory-based dataset</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_dicom_difference
   /auto_examples/show_charset_name
   /auto_examples/dicomtree
   /auto_examples/memory_dataset

Image processing
----------------

These examples illustrate the image processing available in pydicom which can
be applied to DICOM images.

.. raw:: html

.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to downsize an MR image from 512  imes 512 to 64       imes 64. The downsizing is performed by taking the central section instead of averagin the pixels. Finally, the image is store as a dicom image.">

.. only:: html

  .. image:: /auto_examples/image_processing/images/thumb/sphx_glr_plot_downsize_image_thumb.png
    :alt:

  :doc:`/auto_examples/image_processing/plot_downsize_image`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Downsize MRI image using pydicom</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how to plot waveforms from a Waveform Sequence using matplotlib.">

.. only:: html

  .. image:: /auto_examples/image_processing/images/thumb/sphx_glr_plot_waveforms_thumb.png
    :alt:

  :doc:`/auto_examples/image_processing/plot_waveforms`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Decode and plot Waveform Data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates loading multiple files, sorting them by slice location, building a 3D image and reslicing it in different planes.">

.. only:: html

  .. image:: /auto_examples/image_processing/images/thumb/sphx_glr_reslice_thumb.png
    :alt:

  :doc:`/auto_examples/image_processing/reslice`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Load CT slices and plot axial, sagittal and coronal images</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Input-output
------------

These examples illustrate the use of pydicom to read DICOM data.

.. raw:: html

.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Given an RTPLAN DICOM file, list basic info for the beams in it.">

.. only:: html

  .. image:: /auto_examples/input_output/images/thumb/sphx_glr_plot_read_rtplan_thumb.png
    :alt:

  :doc:`/auto_examples/input_output/plot_read_rtplan`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Read RTPLAN DICOM and list information</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how to open a DICOM file, print some dataset information, and show it using matplotlib.">

.. only:: html

  .. image:: /auto_examples/input_output/images/thumb/sphx_glr_plot_read_dicom_thumb.png
    :alt:

  :doc:`/auto_examples/input_output/plot_read_dicom`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Read a Dataset and plot Pixel Data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how to print the data set in your own format.">

.. only:: html

  .. image:: /auto_examples/input_output/images/thumb/sphx_glr_plot_printing_dataset_thumb.png
    :alt:

  :doc:`/auto_examples/input_output/plot_printing_dataset`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Format the output of the data set printing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to write a DICOM file from scratch using pydicom. This example does not produce a DICOM standards compliant file as written, you will have to change UIDs to valid values and add all required DICOM data elements.">

.. only:: html

  .. image:: /auto_examples/input_output/images/thumb/sphx_glr_plot_write_dicom_thumb.png
    :alt:

  :doc:`/auto_examples/input_output/plot_write_dicom`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Write DICOM data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to read and interact with a DICOM File-set.">

.. only:: html

  .. image:: /auto_examples/input_output/images/thumb/sphx_glr_plot_read_fileset_thumb.png
    :alt:

  :doc:`/auto_examples/input_output/plot_read_fileset`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Read a DICOM File-set</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Metadata processing
-------------------

These examples illustrates the processing available in pydicom to modify the
metadata of DICOM data.

.. raw:: html

.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example is a starting point to anonymize DICOM data.">

.. only:: html

  .. image:: /auto_examples/metadata_processing/images/thumb/sphx_glr_plot_anonymize_thumb.png
    :alt:

  :doc:`/auto_examples/metadata_processing/plot_anonymize`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Anonymize DICOM data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This examples illustrates how to work with sequences.">

.. only:: html

  .. image:: /auto_examples/metadata_processing/images/thumb/sphx_glr_plot_sequences_thumb.png
    :alt:

  :doc:`/auto_examples/metadata_processing/plot_sequences`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Working with sequences</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This examples illustrates how to add private dictionary items to the DICOM dictionary dynamically. This allows you to read private tags not present in pydicom&#x27;s private dictionary when loading an existing dataset.">

.. only:: html

  .. image:: /auto_examples/metadata_processing/images/thumb/sphx_glr_plot_add_dict_entries_thumb.png
    :alt:

  :doc:`/auto_examples/metadata_processing/plot_add_dict_entries`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Add items to the private DICOM dictionary</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:
   :includehidden:


   /auto_examples/image_processing/index.rst
   /auto_examples/input_output/index.rst
   /auto_examples/metadata_processing/index.rst


.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-gallery

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download all examples in Python source code: auto_examples_python.zip </auto_examples/auto_examples_python.zip>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip </auto_examples/auto_examples_jupyter.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
