Mercurial > hg > orthanc-book
annotate Sphinx/source/faq/transcoding.rst @ 660:a6e371768a70
dicom-as-json
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Apr 2021 12:41:31 +0200 |
parents | 9bee264de083 |
children | 1316bc62b5d5 |
rev | line source |
---|---|
275 | 1 .. _transcoding: |
2 | |
3 Transcoding of DICOM files | |
4 ========================== | |
5 | |
411 | 6 .. contents:: |
7 | |
8 | |
275 | 9 General information |
10 ------------------- | |
11 | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
12 **DICOM transcoding** refers to the process of changing the |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
13 :ref:`transfer syntax <dicom-pixel-data>` of some DICOM instance. |
275 | 14 |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
15 Transcoding can be used to **compress** DICOM images, which is useful |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
16 to reduce the required storage area or to optimize the network |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
17 bandwidth for exchanges between sites. Conversely, transcoding can be |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
18 used to **decompress** DICOM images, which is needed as many DICOM |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
19 viewers or specialized analysis software do not provide support for |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
20 compressed transfer syntaxes. |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
21 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
22 Support for transcoding was introduced in Orthanc 1.7.0. |
275 | 23 |
24 | |
25 Motivation for transcoding | |
26 -------------------------- | |
27 | |
28 Let's consider the following basic workflow, in which some imaging | |
29 workstation must access a medical image that originates from a PACS | |
30 and that is served through an Orthanc proxy: | |
31 | |
32 .. image:: ../images/Transcoding1.svg | |
33 :align: center | |
34 :width: 700px | |
35 | |
36 This is quite a common situation, e.g. in university hospitals where | |
37 researchers must access medical images without having authorization to | |
38 log in the clinical PACS. It is also common if the main PACS restricts | |
39 the number of workstations that can directly be connected to it, or if | |
40 Orthanc acts as gateway through Internet. | |
41 | |
42 The problem is that the software running on workstations might not be | |
43 able to display some DICOM transfer syntaxes. This is especially true | |
44 in research software, that is often limited to uncompressed transfer | |
45 syntaxes. For instance, let's consider the following scenario where a | |
46 workstation wants to access an image from the PACS: | |
47 | |
48 .. image:: ../images/Transcoding2.svg | |
49 :align: center | |
50 :width: 700px | |
51 | |
52 A typical PACS system will decide, when requested to export an image | |
53 using DICOM C-Store, to compress the image in order to reduce the | |
54 network bandwidth and the storage requirements. Orthanc is fine with | |
55 it: As a vendor neutral archive, Orthanc can basically | |
56 receive/store/transmit any DICOM transfer syntax. Unfortunately, this | |
57 might not be the case of the target workstation, that is often limited | |
58 to some selected transfer syntaxes. As a consequence, the workstation | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
59 will complain about not being to use the DICOM file (in the situation |
275 | 60 depicted above, because the PACS has decided to send the DICOM image |
61 using the JPEG2k transfer syntax). | |
62 | |
63 | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
64 Transcoding in Orthanc |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
65 ---------------------- |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
66 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
67 Orthanc 1.7.0 was the first release of Orthanc to feature built-in |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
68 support for DICOM transcoding. Transcoding is available at multiple |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
69 levels, as depicted by the green arrows on the following drawing: |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
70 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
71 .. image:: ../images/Transcoding-1.7.0.svg |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
72 :align: center |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
73 :width: 500px |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
74 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
75 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
76 * **Automated transcoding while ingesting**. Orthanc can be configured |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
77 to automatically transcode each DICOM instance it receives (either |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
78 by DICOM protocol or by REST API) to a fixed transfer syntax. This |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
79 is especially useful to either create an archive of compressed files |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
80 (for long-term archiving), or to create a DICOM buffer with |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
81 uncompressed files (for interfacing with DICOM modalities that do |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
82 not support compressed transfer syntaxes). If the transcoding fails, |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
83 the DICOM instance is still stored using its original transfer |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
84 syntax. |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
85 |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
86 Automated transcoding is enabled by setting the :ref:`configuration |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
87 option <configuration>` ``IngestTranscoding`` to the transfer syntax |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
88 UID of interest. For instance, setting ``IngestTranscoding`` to |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
89 ``1.2.840.10008.1.2.1`` will decompress all the received DICOM |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
90 instances. Conversely, setting it to ``1.2.840.10008.1.2.4.70`` will |
468
7d8b95b1b22c
Fixed name of 1.2.840.10008.1.2.4.70 transfer syntax (JPEG Lossless). See https://www.dicomlibrary.com/dicom/transfer-syntax/
Benjamin Golinvaux <bgo@osimis.io>
parents:
449
diff
changeset
|
91 compress and store images using JPEG Lossless. |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
92 |
567
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
93 NB: Starting with Orthanc 1.8.2, the option |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
94 ``IngestTranscodingOfUncompressed`` |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
95 (resp. ``IngestTranscodingOfCompressed``) is available to control |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
96 whether the ingest transcoding is applied to uncompressed transfer |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
97 syntaxes (resp. compressed transfer syntaxes). By "uncompressed" |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
98 transfer syntaxes, we mean Little Endian Implicit, Little Endian |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
99 Explicit, or Big Endian Explicit. By default, these options are |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
100 considered as equal to ``true``, meaning that all the transfer |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
101 syntaxes are transcoded. |
9bee264de083
documentation of IngestTranscodingOfCompressed and IngestTranscodingOfUncompressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
468
diff
changeset
|
102 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
103 * **Decompression while sending instances using the DICOM protocol**. |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
104 Orthanc can be configured to automatically decompress DICOM images |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
105 on its outgoing connections, if the remote modality does not support |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
106 the compressed transfer syntax of the source DICOM instances. This |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
107 feature is available for both :ref:`DICOM C-Move and C-Get commands |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
108 <dicom-move>`. Note that Orthanc won't transcode DICOM instances to |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
109 a compressed transfer syntax over the DICOM protocol. |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
110 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
111 By default, this automated decompression is enabled. This might be |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
112 undesirable if you want to limit the resources that are used by |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
113 Orthanc. As a consequence, you can disable this feature either |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
114 globally (by setting configuration option ``TranscodeDicomProtocol`` |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
115 to ``false``), or on a per-modality basis (by setting the option |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
116 ``AllowTranscoding`` to ``false`` in the ``DicomModalities`` |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
117 section). |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
118 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
119 .. highlight:: bash |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
120 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
121 * **Transcoding while sending instances to an Orthanc peer**. The |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
122 ``/peers/{id}/store`` route in the Orthanc REST API allows to send |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
123 DICOM resources (patients, studies, series or instances) to |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
124 :ref:`another Orthanc server over HTTP/HTTPS <peering>`. Starting |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
125 with Orthanc 1.7.0, the ``Transcode`` option can be used in the JSON |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
126 POST body to instruct to transcode the DICOM files before they are |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
127 sent. For instance:: |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
128 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
129 $ curl -X POST http://localhost:8042/peers/sample/store -d '{"Transcode":"1.2.840.10008.1.2.4.70","Resources":["66c8e41e-ac3a9029-0b85e42a-8195ee0a-92c2e62e"]}' |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
130 |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
131 * **Transcoding using the REST API**. Starting with Orthanc 1.7.0, |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
132 some routes in the REST API also accept the ``Transcode`` option |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
133 in their JSON POST body. Those routes notably include: |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
134 |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
135 * The routes to create ZIP files or DICOMDIR archives (``.../media`` |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
136 and ``.../archive``). |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
137 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
138 * The routes to modify DICOM resources |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
139 (``/{patients|studies|series|instances}/{id}/modify``). |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
140 |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
141 Importantly, if you need to transcode JPEG2k DICOM instances, you'll |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
142 have to install the :ref:`GDCM plugin <gdcm>` that replaces the |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
143 built-in transcoder of Orthanc based on DCMTK, by the GDCM transcoder. |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
144 |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
145 The following :ref:`advanced configuration options <configuration>` |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
146 are also available to control transcoding: |
275 | 147 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
148 * ``BuiltinDecoderTranscoderOrder`` controls the transcoder that is |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
149 used by Orthanc. It specifies whether the built-in transcoder of |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
150 Orthanc (that uses DCMTK) is applied before or after the transcoding |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
151 plugins, or not applied at all. "After" means that the built-in |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
152 transcoder is applied if all the transcoding plugins have failed to |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
153 transcode the image. |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
154 |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
155 * ``DicomLossyTranscodingQuality`` controls the quality level of lossy |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
427
diff
changeset
|
156 compression (notably for JPEG transcoding). |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
157 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
158 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
159 Solutions to avoid transcoding |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
160 ------------------------------ |
275 | 161 |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
162 Up to release 1.6.1, Orthanc didn't feature support for transcoding |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
163 DICOM instances. In other words, the Orthanc core never changed the |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
164 :ref:`transfer syntax <dicom-pixel-data>` of some DICOM instance when |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
165 it had to send it to another modality using the DICOM protocol. |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
166 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
167 Three workarounds were available to bypass the need for DICOM |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
168 transcoding in Orthanc <= 1.6.1. These workarounds are still valid in |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
169 Orthanc >= 1.7.0, if transcoding is undesirable (e.g. if Orthanc is |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
170 being run on a computer with sparse CPU/RAM resources). |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
171 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
172 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
173 Refusing transfer syntaxes |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
174 ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
175 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
176 The first solution consists in making Orthanc **refuse to accept the |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
177 transfer syntaxes** that are not supported by the workstation. This is |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
178 depicted in the following diagram: |
275 | 179 |
180 .. image:: ../images/Transcoding3.svg | |
181 :align: center | |
182 :width: 700px | |
183 | |
184 .. highlight:: json | |
185 | |
186 If Orthanc tells the PACS that is doesn't accept, say, DICOM JPEG2k, | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
187 the source PACS will be aware of this, and will take care of |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
188 transcoding the DICOM files before they are sent to Orthanc. This is |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
189 the role of the following :ref:`configuration options <configuration>` |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
190 that specifies which transfer syntaxes are accepted by Orthanc:: |
275 | 191 |
192 { | |
193 "DeflatedTransferSyntaxAccepted" : true, | |
194 "JpegTransferSyntaxAccepted" : true, | |
195 "Jpeg2000TransferSyntaxAccepted" : true, | |
196 "JpegLosslessTransferSyntaxAccepted" : true, | |
197 "JpipTransferSyntaxAccepted" : true, | |
198 "Mpeg2TransferSyntaxAccepted" : true, | |
199 "RleTransferSyntaxAccepted" : true, | |
200 "UnknownSopClassAccepted" : false | |
201 } | |
202 | |
203 If all of those options are set to ``false``, Orthanc will only | |
204 receive uncompressed transfer syntaxes (obviously provided that the | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
205 source PACS itself supports DICOM transcoding). |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
206 |
275 | 207 |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
208 Using external conversion tools |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
210 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
211 The second solution consists in **applying an external conversion |
275 | 212 tool** to every DICOM image that is received by Orthanc. The standard |
213 command-line tools ``gdcmconv`` from `GDCM | |
214 <http://gdcm.sourceforge.net/html/gdcmconv.html>`__ or ``dcmconv`` | |
215 from `DCMTK <https://support.dcmtk.org/docs/dcmconv.html>`__ can be | |
216 used to change the transfer syntax of a given DICOM file. These tools | |
217 can be invoked from a :ref:`Lua script <lua>` (check out | |
218 ``OnStoredInstance()`` callback) or from an :ref:`Orthanc plugin | |
219 <creating-plugins>` (check out | |
220 ``OrthancPluginRegisterOnStoredInstanceCallback()`` function). A | |
221 sample Lua script that converts every incoming DICOM file to the | |
222 JPEG2k transfer syntax is `part of the Orthanc sources | |
449 | 223 <https://hg.orthanc-server.com/orthanc/file/default/OrthancServer/Resources/Samples/Lua/AutomatedJpeg2kCompression.lua>`__. Note |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
224 that this solution makes no sense anymore in Orthanc 1.7.0, as it |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
225 provides built-in support for transcoding. |
275 | 226 |
227 | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
228 Transcoding buffer |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
229 ^^^^^^^^^^^^^^^^^^ |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
230 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
231 Finally, as a third solution, it is possible to **combine two Orthanc |
275 | 232 servers**, the first one being configured to accept any transfer |
233 syntax, and the second one being responsible to serve the DICOM files | |
234 after conversion to uncompressed transfer syntax (which should be | |
235 compatible with any workstation): | |
236 | |
237 .. image:: ../images/Transcoding4.svg | |
238 :align: center | |
239 :width: 700px | |
240 | |
427
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
241 In this solution, the first Orthanc server acts as a transient server |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
242 that implements the decompression (i.e. it transcodes all the DICOM |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
243 instances it receives to an uncompressed transfer syntax). To carry on |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
244 the transcoding, this first Orthanc server can be: |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
245 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
246 * either an instance Orthanc >= 1.7.0, with transcoding enabled, or |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
247 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
248 * an instance of Orthanc (any version) equipped with a plugin or an |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
249 external script to do the necessary conversions to an uncompressed |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
250 transfer syntax, as explained in the second solution above. |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
251 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
252 Whenever a DICOM instance is received by the first Orthanc, the DICOM |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
253 instance is thus transcoded. The first Orthanc server automatically |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
254 forwards all the transcoded instances to the second instance of |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
255 Orthanc, thanks to a :ref:`Lua script <lua>` or an :ref:`external |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
256 script <rest>`, taking advantage of :ref:`Orthanc peering <peering>`. |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
257 |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
258 Contrarily to the second solution, this solution has the advantage of |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
259 better scalability (as decompression can be a time-consuming |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
260 operation). The second instance of Orthanc can run even on a low-end |
71281b540ca1
updating old documentation about transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
419
diff
changeset
|
261 computer, with any version of Orthanc. |