comparison Sphinx/source/plugins/ohif.rst @ 953:2038eb1f55bb

finalized ohif documentation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 19 Jun 2023 08:00:51 +0200
parents 4a76327e83fb
children 19fd9eab4ec0
comparison
equal deleted inserted replaced
952:4a76327e83fb 953:2038eb1f55bb
8 8
9 This **official** plugin by the `ICTEAM institute of UCLouvain 9 This **official** plugin by the `ICTEAM institute of UCLouvain
10 <https://uclouvain.be/en/research-institutes/icteam>`__ extends 10 <https://uclouvain.be/en/research-institutes/icteam>`__ extends
11 Orthanc with the `OHIF <https://ohif.org/>`__ extensible Web imaging 11 Orthanc with the `OHIF <https://ohif.org/>`__ extensible Web imaging
12 platform. 12 platform.
13
14 The plugin greatly simplifies the deployment of OHIF, as it does not
15 necessitate the setup of any reverse proxy. It also speeds up the
16 loading of
13 17
14 18
15 Usage 19 Usage
16 ----- 20 -----
17 21
23 :align: center 27 :align: center
24 :width: 800 28 :width: 800
25 :target: https://www.youtube.com/watch?v=-lzddzq9iT4 29 :target: https://www.youtube.com/watch?v=-lzddzq9iT4
26 | 30 |
27 31
28 The plugin greatly simplifies the deployment of OHIF, as it does not
29 necessitate the setup of any reverse proxy.
30
31 32
32 Compilation 33 Compilation
33 ----------- 34 -----------
34 35
35 .. highlight:: bash 36 .. highlight:: bash
86 87
87 88
88 Using DICOMweb 89 Using DICOMweb
89 ^^^^^^^^^^^^^^ 90 ^^^^^^^^^^^^^^
90 91
92 .. highlight:: json
93
91 By default, the plugin uses the `DICOM JSON data source 94 By default, the plugin uses the `DICOM JSON data source
92 <https://v3-docs.ohif.org/configuration/datasources/dicom-json/>`__ of 95 <https://v3-docs.ohif.org/configuration/datasources/dicom-json/>`__ of
93 OHIF. This data source is optimized to provide the fastest access to 96 OHIF. This data source is optimized to provide the fastest access to
94 the DICOM images, while requiring no additional plugin. However, in 97 the DICOM images, while requiring no additional plugin. However, in
95 order to deliver fast access, the OHIF plugin will cache additional 98 order to deliver fast access, the OHIF plugin will cache additional
96 information about each DICOM instance in the Orthanc database, which 99 information about each DICOM instance as :ref:`metadata <metadata>` in
97 results in a larger size of the Orthanc database (an additional 1KB is 100 the Orthanc database, which results in a larger size of the Orthanc
98 roughly needed per instance). 101 database (an additional 1KB is roughly needed per instance).
99 102
100 It is also possible to enable the `DICOMweb data source 103 As an alternative, it is possible to enable the `DICOMweb data source
101 <https://v3-docs.ohif.org/configuration/dataSources/dicom-web>`__. In 104 <https://v3-docs.ohif.org/configuration/dataSources/dicom-web>`__. In
102 this case, the :ref:`DICOMweb plugin of Orthanc <dicomweb>` must also 105 this case, the :ref:`DICOMweb plugin of Orthanc <dicomweb>` must also
103 be loaded. It can also be useful to load the :ref:`GDCM plugin <gdcm>` 106 be loaded. It can also be useful to load the :ref:`GDCM plugin <gdcm>`
104 if the images use a compressed transfer syntax. 107 if the DICOM images are encoded using a JPEG2k compressed transfer
108 syntax.
105 109
106 The advantages of using DICOMweb over the default DICOM JSON are: 110 The advantages of using DICOMweb over the default DICOM JSON are:
107 111
108 * More standard-compliant. 112 * More standard-compliant.
109 113
110 * The OHIF study list is accessible, notably as a button on the 114 * The OHIF study list is accessible, notably as a button on the
111 welcome screen of Orthanc Explorer. 115 welcome screen of Orthanc Explorer. The study list is not available
116 if using the DICOM JSON data source.
112 117
113 * No additional space is used in the Orthanc database. 118 * No additional space is used in the Orthanc database.
114 119
115 Here is a minimal configuration file to use DICOMweb:: 120 Here is a minimal configuration file to use DICOMweb::
116 121
126 131
127 132
128 Router basename 133 Router basename
129 ^^^^^^^^^^^^^^^ 134 ^^^^^^^^^^^^^^^
130 135
136 .. highlight:: json
137
131 If Orthanc is not branched at the root of a Web server thanks of the 138 If Orthanc is not branched at the root of a Web server thanks of the
132 presence of a reverse proxy, the configuration option 139 presence of a reverse proxy, the configuration option
133 ``RouterBasename`` must be adapted. 140 ``RouterBasename`` must be adapted.
134 141
135 For instance, if Orthanc is running at address 142 For instance, if Orthanc is running at address
146 } 153 }
147 154
148 The default value of ``RouterBasename`` is ``/ohif/``. 155 The default value of ``RouterBasename`` is ``/ohif/``.
149 156
150 157
158 .. _ohif-preloading:
159
151 Preloading 160 Preloading
152 ^^^^^^^^^^ 161 ^^^^^^^^^^
153 162
163 .. highlight:: json
164
165 If using the DICOM JSON data source, whenever a new DICOM instance is
166 received by Orthanc, the OHIF plugin will compute a summary of the
167 DICOM tags of interest to OHIF, and will store it as :ref:`metadata
168 <metadata>` in the Orthanc database. This process has the advantage of
169 speeding up even the first opening of the DICOM study by OHIF, which
170 probably corresponds to the expectations of most radiologists.
171
172 However, if your Orthanc deployment is focused on speed, this
173 preloading might be undesirable, as it slows down the ingestion of new
174 DICOM instances by Orthanc. Furthermore, if your Orthanc server will
175 contain a large number of DICOM studies that will never be displayed
176 using OHIF, this can result in a waste of space in the Orthanc
177 database because of the metadata that will be preloaded, but that will
178 never be read.
179
180 It is consequently possible to turn off the automated preloading
181 of metadata using the following configuration::
182
183 {
184 "Plugins" : [
185 "/home/user/orthanc-ohif/Build/libOHIF.so"
186 ],
187 "OHIF" : {
188 "DataSource" : "dicom-json",
189 "Preload" : false
190 }
191 }
192
193 If the ``Preload`` option is set to ``false``, the first display of a
194 DICOM study can take several seconds because of the computation of the
195 metadata, but subsequent displays will run much faster.
196
197 Note that preloading is only applied to the newly received instances:
198 The DICOM instances that were stored in the Orthanc server before the
199 installation of the OHIF plugin will only benefit from the
200 optimization starting with their second display using OHIF.
201
202
203 For developers
204 --------------
205
206 Extensions to the REST API
207 ^^^^^^^^^^^^^^^^^^^^^^^^^^
208
209 .. highlight:: bash
210
211 The content of the `DICOM JSON data source
212 <https://v3-docs.ohif.org/configuration/datasources/dicom-json/>`__
213 for a DICOM study of interest can be retrieved as follows::
214
215 $ curl http://demo.orthanc-server.com/studies/6b9e19d9-62094390-5f9ddb01-4a191ae7-9766b715/ohif-dicom-json
216
217 This data source is constructed from the :ref:`metadata 4202
218 <registry>` associated with the individual DICOM instances of the
219 DICOM study. The metadata corresponds to the `Base64 encoding
220 <https://en.wikipedia.org/wiki/Base64>`__ of a gzipped JSON file. For
221 debugging, the JSON file associated with a DICOM instance can be
222 inspected using::
223
224 $ curl http://demo.orthanc-server.com/instances/1f3c00bd-49df10b7-f416a598-1b3bb5a2-cb791b52/metadata/4202 | base64 -d | gunzip -c
225
226
227 Preloading existing studies
228 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
229
230 :ref:`As explained above <ohif-preloading>`, the metadata associated
231 with DICOM instances are only preloaded for the newly ingested DICOM
232 instances. Using the REST API of Orthanc, it is easy to create a
233 script that would preload the metadata for the already existing DICOM
234 studies, hereby greatly speeding up the first opening of those studies
235 as well.
236
237 This script would loop over the :ref:`the DICOM studies that are stored
238 by Orthanc <rest-access>` using ``GET /studies``. For each study whose
239 :ref:`Orthanc identifier <orthanc-identifiers>` is ``id``, the script
240 would simply call ``GET /studies/{id}/ohif-dicom-json``.
241