changeset 732:bfc31c51809f

download pdf and videos
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Jun 2021 07:36:53 +0200
parents f4ff5a1af41e
children ac493614ba2e
files Sphinx/source/faq/features.rst Sphinx/source/faq/video.rst Sphinx/source/users/rest.rst
diffstat 3 files changed, 39 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/faq/features.rst	Tue Jun 29 17:37:12 2021 +0200
+++ b/Sphinx/source/faq/features.rst	Wed Jun 30 07:36:53 2021 +0200
@@ -111,6 +111,7 @@
 resources stored inside Orthanc. Once one DICOM instance leaves the
 Orthanc ecosystem, its associated metadata and attachments are lost.
 
+.. _metadata-core:
 
 Core metadata
 ^^^^^^^^^^^^^
@@ -136,8 +137,11 @@
   is expected to contain. This information is :ref:`not always
   available <series-completion>`.
 * Starting with Orthanc 1.2.0, ``TransferSyntax`` and ``SopClassUid``
-  respectively stores the transfer syntax UID and the SOP class UID of
-  DICOM instances, in order to speed up the access to this
+  respectively stores the `transfer syntax UID
+  <http://dicom.nema.org/medical/dicom/current/output/html/part05.html#chapter_10>`__
+  and the `SOP class UID
+  <http://dicom.nema.org/medical/dicom/current/output/chtml/part02/sect_A.1.html>`__
+  of DICOM instances, in order to speed up the access to this
   information.
 * ``RemoteIP`` (new in Orthanc 1.4.0): The IP address of the remote
   SCU (for REST API and DICOM protocol).
--- a/Sphinx/source/faq/video.rst	Tue Jun 29 17:37:12 2021 +0200
+++ b/Sphinx/source/faq/video.rst	Wed Jun 30 07:36:53 2021 +0200
@@ -1,3 +1,5 @@
+.. _videos:
+
 Does Orthanc support videos?
 ============================
 
@@ -20,6 +22,10 @@
 distinction is also discussed in :ref:`another FAQ entry
 <supported-images>`.
 
+It is easy to **extract and download** the raw video embedded in the
+DICOM instance using the :ref:`REST API of Orthanc
+<download-pdf-videos>`.
+
 If you also want to **play** the videos, the :ref:`Osimis Web Viewer
 plugin <osimis_webviewer>` is able to play H.264 (MPEG4) videos and
 2D+t (cine) sequences but not MPEG2 videos that currently can not be
--- a/Sphinx/source/users/rest.rst	Tue Jun 29 17:37:12 2021 +0200
+++ b/Sphinx/source/users/rest.rst	Wed Jun 30 07:36:53 2021 +0200
@@ -442,6 +442,33 @@
   $ curl http://localhost:8042/studies/6b9e19d9-62094390-5f9ddb01-4a191ae7-9766b715/media > Study.zip
 
 
+.. _download-pdf-videos:
+
+Downloading PDF or videos
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. highlight:: bash
+
+Given a DICOM instance that embeds a PDF file (typically, one instance
+whose SOP Class UID is ``1.2.840.10008.5.1.4.1.1.104.1`` -
+Encapsulated PDF Storage), the PDF content can be downloaded as
+follows::
+
+  $ curl http://localhost:8042/instances/1915e0cc-c2c1a0fc-12cdd7f5-3ba32114-a97c2c9b/content/0042,0011 > sample.pdf
+
+This corresponds to downloading the raw DICOM tag "Encapsulated
+Document" (0042,0011). Beware that the last byte of the downloaded
+file might correspond to one padding byte, if the source PDF had an
+odd number of bytes.
+
+Similarly, if you know that a DICOM instance :ref:`embeds a video
+<videos>` (which can be tested by checking the :ref:`value of the
+metadata <metadata-core>` corresponding to its transfer syntax UID),
+the raw video can be downloaded as follows::
+
+  $ curl http://localhost:8042/instances/e465dd27-83c96343-96848735-7035a133-1facf1a0/frames/0/raw > sample.mp4
+
+
 .. _peering:
 
 Sending resources to remote Orthanc over HTTP/HTTPS (through Orthanc peering)