annotate Sphinx/source/faq/transcoding.rst @ 409:0d02abd26842

note
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 May 2020 06:58:18 +0200
parents 0fb9369e893e
children b4cc2b6a9f13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
275
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _transcoding:
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 Transcoding of DICOM files
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ==========================
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 General information
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 -------------------
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
392
0fb9369e893e Orthanc 1.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 360
diff changeset
9 As of release 1.6.1, Orthanc does not feature support for transcoding
275
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 DICOM instances yet. In other words, the Orthanc core never changes
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 the :ref:`transfer syntax <dicom-pixel-data>` of some DICOM instance
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 when it has to send it to another modality using the DICOM protocol.
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 Adding support for transcoding is one of the features that is pending
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 on `our roadmap
360
d217af5e6cb3 links to hg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 336
diff changeset
16 <https://hg.orthanc-server.com/orthanc/file/default/TODO>`__, and for which
275
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 we are looking for industrial sponsors.
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 Motivation for transcoding
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 --------------------------
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 Let's consider the following basic workflow, in which some imaging
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 workstation must access a medical image that originates from a PACS
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 and that is served through an Orthanc proxy:
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 .. image:: ../images/Transcoding1.svg
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 :align: center
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 :width: 700px
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 This is quite a common situation, e.g. in university hospitals where
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 researchers must access medical images without having authorization to
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 log in the clinical PACS. It is also common if the main PACS restricts
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 the number of workstations that can directly be connected to it, or if
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 Orthanc acts as gateway through Internet.
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 The problem is that the software running on workstations might not be
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 able to display some DICOM transfer syntaxes. This is especially true
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 in research software, that is often limited to uncompressed transfer
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 syntaxes. For instance, let's consider the following scenario where a
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 workstation wants to access an image from the PACS:
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 .. image:: ../images/Transcoding2.svg
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 :align: center
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 :width: 700px
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 A typical PACS system will decide, when requested to export an image
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 using DICOM C-Store, to compress the image in order to reduce the
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 network bandwidth and the storage requirements. Orthanc is fine with
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 it: As a vendor neutral archive, Orthanc can basically
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 receive/store/transmit any DICOM transfer syntax. Unfortunately, this
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 might not be the case of the target workstation, that is often limited
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 to some selected transfer syntaxes. As a consequence, the workstation
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 will complain about not being to read the DICOM file (in the situation
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 depicted above, because the PACS has decided to send the DICOM image
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 using the JPEG2k transfer syntax).
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 Solutions
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 ---------
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 There are basically 4 solutions to this issue. The first one, as
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 stated above, would be to **implement transcoding in Orthanc**. Feel
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 free to `get in touch with us
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 <https://www.orthanc-server.com/orthanc-pro.php>`__ if you want to
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 sponsor this development.
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 The second solution consists in making Orthanc **refuse to accept the
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 transfer syntaxes** that are not supported by the workstation. This
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 is depicted in the following diagram:
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 .. image:: ../images/Transcoding3.svg
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 :align: center
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 :width: 700px
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 .. highlight:: json
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 If Orthanc tells the PACS that is doesn't accept, say, DICOM JPEG2k,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 the source PACS will be aware of this, and will transcode the DICOM
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 file before it is sent to Orthanc. This is the role of the following
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 :ref:`configuration options <configuration>` that specifies which
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 transfer syntaxes are accepted by Orthanc::
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 {
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 "DeflatedTransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 "JpegTransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 "Jpeg2000TransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 "JpegLosslessTransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 "JpipTransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 "Mpeg2TransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 "RleTransferSyntaxAccepted" : true,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 "UnknownSopClassAccepted" : false
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 }
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 If all of those options are set to ``false``, Orthanc will only
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 receive uncompressed transfer syntaxes (obviously provided that the
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 source PACS supports DICOM transcoding).
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 The third solution consists in **applying an external conversion
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 tool** to every DICOM image that is received by Orthanc. The standard
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 command-line tools ``gdcmconv`` from `GDCM
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 <http://gdcm.sourceforge.net/html/gdcmconv.html>`__ or ``dcmconv``
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 from `DCMTK <https://support.dcmtk.org/docs/dcmconv.html>`__ can be
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 used to change the transfer syntax of a given DICOM file. These tools
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 can be invoked from a :ref:`Lua script <lua>` (check out
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 ``OnStoredInstance()`` callback) or from an :ref:`Orthanc plugin
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 <creating-plugins>` (check out
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 ``OrthancPluginRegisterOnStoredInstanceCallback()`` function). A
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 sample Lua script that converts every incoming DICOM file to the
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 JPEG2k transfer syntax is `part of the Orthanc sources
360
d217af5e6cb3 links to hg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 336
diff changeset
111 <https://hg.orthanc-server.com/orthanc/file/default/Resources/Samples/Lua/AutomatedJpeg2kCompression.lua>`__.
275
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 Finally, as a fourth solution, it is possible to **combine two Orthanc
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 servers**, the first one being configured to accept any transfer
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 syntax, and the second one being responsible to serve the DICOM files
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 after conversion to uncompressed transfer syntax (which should be
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 compatible with any workstation):
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 .. image:: ../images/Transcoding4.svg
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 :align: center
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 :width: 700px
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 In this solution, a plugin or an external script continuously monitors
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 the content of the first Orthanc server thanks to its :ref:`REST API
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 <rest>`. Whenever a DICOM instance is received by the first Orthanc,
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 the plugin/script uses external conversion tools to convert the
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 instance to an uncompressed transfer syntax, then forward it to a
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 second Orthanc server. In other words, the first Orthanc server acts
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 as a transient buffer for decompression. Contrarily to the third
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 solution, this solution has the advantage of better scalability (as
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 decompression implemented in a Lua callback blocks Orthanc as long as
2946fcd2e7fa transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 the Lua script has not returned).