Mercurial > hg > orthanc-book
comparison Sphinx/source/plugins/dicomweb.rst @ 260:f9e7036d81d0
updating DICOMweb documentation
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Jun 2019 09:46:04 +0200 |
parents | 949a13b92195 |
children | 3391edf37359 |
comparison
equal
deleted
inserted
replaced
259:c2c436ce92d6 | 260:f9e7036d81d0 |
---|---|
9 This **official** plugin extends Orthanc with support of the `DICOMweb | 9 This **official** plugin extends Orthanc with support of the `DICOMweb |
10 protocols <https://en.wikipedia.org/wiki/DICOMweb>`__. More precisely, | 10 protocols <https://en.wikipedia.org/wiki/DICOMweb>`__. More precisely, |
11 the plugin introduces a basic, reference implementation of WADO-URI, | 11 the plugin introduces a basic, reference implementation of WADO-URI, |
12 WADO-RS, QIDO-RS and STOW-RS, following `DICOM PS3.18 | 12 WADO-RS, QIDO-RS and STOW-RS, following `DICOM PS3.18 |
13 <http://dicom.nema.org/medical/dicom/current/output/html/part18.html>`__. | 13 <http://dicom.nema.org/medical/dicom/current/output/html/part18.html>`__. |
14 The plugin simultaneously turns Orthanc into a **DICOMweb server** and | |
15 into a **DICOMweb client**. | |
14 | 16 |
15 For general information, check out the `official homepage of the | 17 For general information, check out the `official homepage of the |
16 plugins <http://www.orthanc-server.com/static.php?page=dicomweb>`__. | 18 plugins <http://www.orthanc-server.com/static.php?page=dicomweb>`__. |
17 | 19 |
18 The full standard is not implemented yet, the supported features are | 20 The full standard is not implemented yet, the supported features are |
47 *Remark:* Some older build instructions are also available in the | 49 *Remark:* Some older build instructions are also available in the |
48 `source distribution | 50 `source distribution |
49 <https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/BuildInstructions.txt>`__. | 51 <https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/BuildInstructions.txt>`__. |
50 | 52 |
51 | 53 |
52 Usage | 54 Installation |
53 ----- | 55 ------------ |
54 | 56 |
55 .. highlight:: json | 57 .. highlight:: json |
56 | 58 |
57 You of course first have to :ref:`install Orthanc <binaries>`. Once | 59 You of course first have to :ref:`install Orthanc <binaries>`. Once |
58 Orthanc is installed, you must change the :ref:`configuration file | 60 Orthanc is installed, you must change the :ref:`configuration file |
112 "Enable" : true, // Whether DICOMweb support is enabled | 114 "Enable" : true, // Whether DICOMweb support is enabled |
113 "Root" : "/dicom-web/", // Root URI of the DICOMweb API (for QIDO-RS, STOW-RS and WADO-RS) | 115 "Root" : "/dicom-web/", // Root URI of the DICOMweb API (for QIDO-RS, STOW-RS and WADO-RS) |
114 "EnableWado" : true, // Whether WADO-URI (previously known as WADO) support is enabled | 116 "EnableWado" : true, // Whether WADO-URI (previously known as WADO) support is enabled |
115 "WadoRoot" : "/wado", // Root URI of the WADO-URI (aka. WADO) API | 117 "WadoRoot" : "/wado", // Root URI of the WADO-URI (aka. WADO) API |
116 "Ssl" : false, // Whether HTTPS should be used for subsequent WADO-RS requests | 118 "Ssl" : false, // Whether HTTPS should be used for subsequent WADO-RS requests |
119 "QidoCaseSensitive" : true, // For QIDO-RS server, whether search is case sensitive (since release 0.5) | |
120 "Host" : "localhost" // Hard-codes the name of the host for subsequent WADO-RS requests (deprecated) | |
121 } | |
122 } | |
123 | |
124 Furthermore, the global option ``DefaultEncoding`` specifies the | |
125 encoding (specific character set) that will be used when answering a | |
126 QIDO-RS request. It might be a good idea to set this option to | |
127 ``Utf8`` if you are dealing with an international environment. | |
128 | |
129 The following configuration options were present in releases <= 0.6 of the plugin, | |
130 but are not used anymore:: | |
131 | |
132 { | |
133 [...] | |
134 "DicomWeb" : { | |
117 "StowMaxInstances" : 10, // For STOW-RS client, the maximum number of instances in one single HTTP query (0 = no limit) | 135 "StowMaxInstances" : 10, // For STOW-RS client, the maximum number of instances in one single HTTP query (0 = no limit) |
118 "StowMaxSize" : 10, // For STOW-RS client, the maximum size of the body in one single HTTP query (in MB, 0 = no limit) | 136 "StowMaxSize" : 10, // For STOW-RS client, the maximum size of the body in one single HTTP query (in MB, 0 = no limit) |
119 "QidoCaseSensitive" : true, // For QIDO-RS server, whether search is case sensitive (since release 0.5) | 137 } |
120 "Host" : "localhost" // Hard-codes the name of the host for subsequent WADO-RS requests (deprecated) | 138 } |
121 } | 139 |
122 } | 140 These older configuration options were used to limit the size of the |
141 HTTP requests, by issuing multiple calls to STOW-RS (set both options | |
142 to 0 to send one single request). | |
143 | |
123 | 144 |
124 **Remark:** The option ``Host`` is deprecated. Starting with release | 145 **Remark:** The option ``Host`` is deprecated. Starting with release |
125 0.7 of the DICOMweb plugin, its value are computed from the standard | 146 0.7 of the DICOMweb plugin, its value are computed from the standard |
126 HTTP headers ``Forwarded`` and ``Host``, as provided by the HTTP | 147 HTTP headers ``Forwarded`` and ``Host``, as provided by the HTTP |
127 clients. | 148 clients. |
166 "sample" : [ "http://192.168.1.1/dicom-web/", "username", "password" ] | 187 "sample" : [ "http://192.168.1.1/dicom-web/", "username", "password" ] |
167 } | 188 } |
168 } | 189 } |
169 } | 190 } |
170 | 191 |
171 If the DICOMweb server is protected with HTTPS client authentication, | 192 Two important options can be provided for individual remote DICOMweb servers: |
172 you must provide your client certificate (in the `PEM format | 193 |
194 * ``HasDelete`` can be set to ``true`` to indicate that the HTTP | |
195 DELETE method can be used to delete remote studies/series/instances. | |
196 This notably adds a "delete" button on the Web interface of the | |
197 DICOMweb client, and creates a route | |
198 ``/dicom-web/servers/sample/delete`` in the REST API. | |
199 | |
200 * ``ChunkedTransfers`` must be set to ``false`` if the remote DICOMweb | |
201 server does not support `HTTP chunked transfer encoding | |
202 <https://en.wikipedia.org/wiki/Chunked_transfer_encoding>`__. Setting | |
203 this option to ``true`` is the best choice to reduce memory | |
204 consumption. However, it must be set to ``false`` if the remote | |
205 DICOMweb server is Orthanc <= 1.5.6, as chunked transfer encoding is | |
206 only supported starting with Orthanc 1.5.7. | |
207 | |
208 You'll have to convert the JSON array into a JSON object to set these | |
209 options:: | |
210 | |
211 { | |
212 [...] | |
213 "DicomWeb" : { | |
214 "Servers" : { | |
215 "sample" : { | |
216 "Url" : "http://192.168.1.1/dicom-web/", | |
217 "Username" : "username", | |
218 "Password" : "password", | |
219 "HasDelete" : true, | |
220 "ChunkedTransfers" : true // Set to "false" if "sample" is Orthanc <= 1.5.6 | |
221 } | |
222 } | |
223 } | |
224 } | |
225 | |
226 | |
227 Furthermore, if the DICOMweb server is protected with HTTPS client | |
228 authentication, you must provide your client certificate (in the `PEM | |
229 format | |
173 <https://en.wikipedia.org/wiki/Privacy-enhanced_Electronic_Mail>`__), | 230 <https://en.wikipedia.org/wiki/Privacy-enhanced_Electronic_Mail>`__), |
174 your client private key (also in the PEM format), together with the | 231 your client private key (also in the PEM format), together with the |
175 password protecting the private key:: | 232 password protecting the private key:: |
176 | 233 |
177 { | 234 { |
205 } | 262 } |
206 } | 263 } |
207 } | 264 } |
208 } | 265 } |
209 | 266 |
267 **Remark:** A :ref:`plugin by Osimis <google>` is available to | |
268 dynamically create authenticated connections to Google Cloud Platform. | |
269 | |
210 **Important remark:** When querying a DICOMweb server, Orthanc will | 270 **Important remark:** When querying a DICOMweb server, Orthanc will |
211 automatically use the global configuration options ``HttpProxy``, | 271 automatically use the global configuration options ``HttpProxy``, |
212 ``HttpTimeout``, ``HttpsVerifyPeers``, ``HttpsCACertificates``, and | 272 ``HttpTimeout``, ``HttpsVerifyPeers``, ``HttpsCACertificates``, and |
213 ``Pkcs11``. Make sure to adapt them if need be. | 273 ``Pkcs11``. Make sure to adapt them if need be. |
214 | 274 |
215 | 275 |
216 Quickstart | 276 Quickstart - DICOMweb client |
217 ---------- | 277 ---------------------------- |
218 | 278 |
219 Once your Orthanc is properly configured (see above), you can make | 279 Starting with version 1.0 of the DICOMweb plugin, a Web interface is |
220 REST calls to the DICOMweb API. For demonstration purpose, this | 280 provided to use Orthanc as a DICOMweb client. Simply click on the |
221 section makes the assumption that the ``VIX`` dataset provided by | 281 "Open DICOMweb client" button at the bottom of the welcome screen of |
222 `OsiriX <http://www.osirix-viewer.com/datasets/>`__ has been uploaded | 282 :ref:`Orthanc Explorer <orthanc-explorer>`. |
223 to Orthanc. | 283 |
284 Here is a direct link to the DICOMweb client running on our demo | |
285 server: | |
286 `http://demo.orthanc-server.com/dicom-web/app/client/index.html | |
287 <http://demo.orthanc-server.com/dicom-web/app/client/index.html>`__ | |
288 | |
289 | |
290 | |
291 Quickstart - DICOMweb server | |
292 ---------------------------- | |
293 | |
294 Once your Orthanc server is properly configured (see above), you can | |
295 make REST calls to the API of the DICOMweb server. For demonstration | |
296 purpose, this section makes the assumption that the ``VIX`` dataset | |
297 provided by `OsiriX <http://www.osirix-viewer.com/datasets/>`__ has | |
298 been uploaded to Orthanc. | |
224 | 299 |
225 WADO-URI | 300 WADO-URI |
226 ^^^^^^^^ | 301 ^^^^^^^^ |
227 | 302 |
228 .. highlight:: text | 303 .. highlight:: text |
229 | 304 |
230 Here is a proper WADO-URI (previously known simply as WADO) request to | 305 Here is a proper WADO-URI (previously known simply as WADO) request to |
231 render one slice of the VIX dataset as a JPEG image:: | 306 render one slice of the VIX dataset as a JPEG image:: |
232 | 307 |
233 http://localhost:8042/wado?objectUID=1.3.12.2.1107.5.1.4.54693.30000006100507010800000005466&requestType=WADO | 308 http://localhost:8042/wado?objectUID=1.3.12.2.1107.5.1.4.54693.30000006100507010800000005466&requestType=WADO |
309 | |
310 | |
311 .. highlight:: bash | |
234 | 312 |
235 The ``objectUID`` corresponds to the ``SOPInstanceUID`` DICOM tag of | 313 The ``objectUID`` corresponds to the ``SOPInstanceUID`` DICOM tag of |
236 some instance in the ``VIX`` dataset. Given the Orthanc identifier of | 314 some instance in the ``VIX`` dataset. Given the Orthanc identifier of |
237 an instance from VIX | 315 an instance from VIX |
238 (e.g. ``14b4db2c-065edecb-6a767936-7068293a-92fcb080``), the latter | 316 (e.g. ``14b4db2c-065edecb-6a767936-7068293a-92fcb080``), the latter |
239 tag can be obtained from the ``MainDicomTags`` field:: | 317 tag can be obtained from the ``MainDicomTags`` field:: |
240 | 318 |
241 # curl http://localhost:8042/instances/14b4db2c-065edecb-6a767936-7068293a-92fcb080 | 319 $ curl http://localhost:8042/instances/14b4db2c-065edecb-6a767936-7068293a-92fcb080 |
320 | |
321 | |
322 QIDO-RS | |
323 ^^^^^^^ | |
324 | |
325 .. highlight:: bash | |
326 | |
327 Regarding QIDO-RS (querying the content of a remote DICOMweb server), | |
328 here is how to obtain the list of studies stored by Orthanc:: | |
329 | |
330 $ curl http://localhost:8042/dicom-web/studies | |
331 | |
332 Note that the ``/dicom-web/`` prefix comes from the configuration | |
333 option ``Root`` of the ``DicomWeb`` section. Filtering the studies is | |
334 possible as follows:: | |
335 | |
336 $ curl http://localhost:8042/dicom-web/studies?PatientName=VIX | |
337 | |
242 | 338 |
243 | 339 |
244 WADO-RS | 340 WADO-RS |
245 ^^^^^^^ | 341 ^^^^^^^ |
246 | 342 |
247 .. highlight:: text | 343 A study can be retrieved through WADO-RS. Here is a sample:: |
248 | 344 |
249 Regarding WADO-RS (i.e. DICOMweb RESTful services), here is how to | 345 $ curl http://localhost:8042/dicom-web/studies/2.16.840.1.113669.632.20.1211.10000315526/ |
250 obtain the tags of all the instances stored by Orthanc:: | 346 |
251 | 347 This answer is a `multipart stream |
252 # curl http://localhost:8042/dicom-web/instances | 348 <https://en.wikipedia.org/wiki/MIME#Multipart_messages>`__ of |
253 | 349 ``application/dicom`` DICOM instances, so a Web browser will not be |
254 Note that, as the MIME type of this answer is a multipart | 350 able to display it (. You will have to use either AJAX (JavaScript) or a |
255 ``application/dicom+xml``, a Web browser will not be able to display | 351 command-line tool (such as cURL). |
256 it. You will have to use either AJAX (JavaScript) or a command-line | 352 |
257 tool (such as curl). | 353 You can render one individual frame as a plain PNG image as follows:: |
258 | 354 |
259 Here is how to generate a JPEG preview of one instance with WADO-RS | 355 $ curl http://localhost:8042/dicom-web/studies/2.16.840.1.113669.632.20.1211.10000315526/series/1.3.12.2.1107.5.1.4.54693.30000006100507010800000005268/instances/1.3.12.2.1107.5.1.4.54693.30000006100507010800000005466/frames/1/rendered -H 'accept: image/png' |
260 (through the RetrieveFrames primitive):: | 356 |
261 | 357 |
262 # curl http://localhost:8042/dicom-web/studies/2.16.840.1.113669.632.20.1211.10000315526/series/1.3.12.2.1107.5.1.4.54693.30000006100507010800000005268/instances/1.3.12.2.1107.5.1.4.54693.30000006100507010800000005466/frames/1 -H 'accept: multipart/related; type=image/dicom+jpeg' | 358 Other endpoints |
359 ^^^^^^^^^^^^^^^ | |
360 | |
361 This page only provides some very basic examples about the use of a | |
362 DICOMweb server. Please check out `the full reference of the DICOMweb | |
363 API <https://www.dicomstandard.org/dicomweb/>`__ for more information. | |
263 | 364 |
264 | 365 |
265 | 366 |
266 .. _dicomweb-client: | 367 .. _dicomweb-client: |
267 | 368 |
268 Querying a remote DICOMweb server with Orthanc | 369 REST API of the Orthanc DICOMweb client |
269 ---------------------------------------------- | 370 --------------------------------------- |
270 | 371 |
271 Listing the available servers | 372 Listing the available servers |
272 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 373 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
273 | 374 |
274 .. highlight:: text | 375 .. highlight:: bash |
275 | 376 |
276 The list of the remote DICOMweb servers that are known to the DICOMweb | 377 The list of the remote DICOMweb servers that are known to the DICOMweb |
277 plugin can be obtained as follows:: | 378 plugin can be obtained as follows:: |
278 | 379 |
279 # curl http://localhost:8042/dicom-web/servers/ | 380 $ curl http://localhost:8042/dicom-web/servers/ |
280 [ "sample" ] | 381 [ "sample" ] |
281 | 382 |
282 Here, a single server called ``sample`` is configured. | 383 In this case, a single server called ``sample`` is configured. |
283 | 384 |
284 | 385 |
285 Making a call to QIDO-RS or WADO-RS | 386 Making a call to QIDO-RS or WADO-RS |
286 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 387 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
287 | 388 |
288 .. highlight:: text | 389 .. highlight:: bash |
289 | 390 |
290 In Orthanc, the URI ``/{dicom-web-root}/servers/{name}/get`` allows to | 391 In Orthanc, the URI ``/{dicom-web-root}/servers/{name}/get`` allows to |
291 make a HTTP GET call against a DICOMweb server. This can be used to | 392 make a HTTP GET call against a DICOMweb server. This can be used to |
292 issue a QIDO-RS or WADO-RS command. Orthanc will take care of properly | 393 issue a QIDO-RS or WADO-RS command. Orthanc will take care of properly |
293 encoding the URL and authenticating the client. | 394 encoding the URL and authenticating the client. For instance, here is |
294 | 395 a sample QIDO-RS search to query all the studies (using a bash |
295 For instance, here is a sample QIDO-RS search to query all the studies | 396 command-line):: |
296 (using a bash command-line):: | 397 |
297 | 398 $ curl http://localhost:8042/dicom-web/servers/sample/get -d @- << EOF |
298 # curl http://localhost:8042/dicom-web/servers/sample/get -d @- << EOF | |
299 { | 399 { |
300 "Uri" : "/studies" | 400 "Uri" : "/studies" |
301 } | 401 } |
302 EOF | 402 EOF |
303 | 403 |
304 You do not have to specify the base URL of the remote DICOMweb server, | 404 The result of this call is a JSON document formatted according to the |
305 as it is encoded in the configuration file. | 405 DICOMweb standard. You do not have to specify the base URL of the |
306 | 406 remote DICOMweb server, as it is encoded in the configuration file. |
307 The result of the command above is a multipart | 407 |
308 ``application/dicom+xml`` document. It is possible to request a more | 408 As a more advanced example, here is how to search all the series |
309 human-friendly JSON answer by adding the ``Accept`` HTTP header. Here | 409 associated with a given patient name, while requesting to use an XML |
310 is how to search for a given patient name, while requesting a JSON | 410 format:: |
311 answer and pretty-printing through the ``json_pp`` command-line tool:: | 411 |
312 | 412 $ curl http://localhost:8042/dicom-web/servers/sample/get -d @- << EOF |
313 # curl http://localhost:8042/dicom-web/servers/sample/get -d @- << EOF | json_pp | 413 { |
314 { | 414 "Uri" : "/series", |
315 "Uri" : "/studies", | |
316 "HttpHeaders" : { | 415 "HttpHeaders" : { |
317 "Accept" : "application/json" | 416 "Accept" : "application/dicom+xml" |
318 }, | 417 }, |
319 "Arguments" : { | 418 "Arguments" : { |
320 "00100010" : "*JODOGNE*" | 419 "00100010" : "KNIX" |
321 } | 420 } |
322 } | 421 } |
323 EOF | 422 EOF |
324 | 423 |
325 Note how all the GET arguments for the QIDO-RS request must be | 424 The result of the command above is a `multipart stream |
425 <https://en.wikipedia.org/wiki/MIME#Multipart_messages>`__ of XML | |
426 documents describing each series. | |
427 | |
428 Note how all the GET arguments to the QIDO-RS request must be | |
326 specified in the ``Arguments`` field. Orthanc will take care of | 429 specified in the ``Arguments`` field. Orthanc will take care of |
327 properly encoding it to a URL. | 430 `properly encoding it as an URL |
431 <https://en.wikipedia.org/wiki/Percent-encoding>`__. | |
328 | 432 |
329 An user-friendly reference of the features available in QIDO-RS and | 433 An user-friendly reference of the features available in QIDO-RS and |
330 WADO-RS `can be found on this site <http://www.dicomweb.org/>`__. | 434 WADO-RS `can be found on this site <http://www.dicomweb.org/>`__. |
331 | 435 |
332 | 436 |
333 Sending DICOM resources to a STOW-RS server | 437 Sending DICOM resources to a STOW-RS server |
334 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 438 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
335 | 439 |
336 .. highlight:: text | 440 .. highlight:: bash |
337 | 441 |
338 STOW-RS allows to send local DICOM resources to a remote DICOMweb | 442 STOW-RS allows to send local DICOM resources to a remote DICOMweb |
339 server. In Orthanc, the STOW-RS client primitive is available at URI | 443 server. In Orthanc, the STOW-RS client primitive is available at URI |
340 ``/{dicom-web-root}/servers/{name}/stow``. Here is a sample call:: | 444 ``/{dicom-web-root}/servers/{name}/stow``. Here is a sample call:: |
341 | 445 |
342 # curl http://localhost:8042/dicom-web/servers/sample/stow -X POST -d @- << EOF | 446 $ curl http://localhost:8042/dicom-web/servers/sample/stow -X POST -d @- << EOF |
343 { | 447 { |
344 "Resources" : [ | 448 "Resources" : [ |
345 "6ca4c9f3-5e895cb3-4d82c6da-09e060fe-9c59f228" | 449 "6ca4c9f3-5e895cb3-4d82c6da-09e060fe-9c59f228" |
346 ] | 450 ] |
347 } | 451 } |
349 | 453 |
350 Note that this primitive takes as its input a list of :ref:`Orthanc | 454 Note that this primitive takes as its input a list of :ref:`Orthanc |
351 identifiers <orthanc-ids>` corresponding to the resources (patients, | 455 identifiers <orthanc-ids>` corresponding to the resources (patients, |
352 studies, series and/or instances) to be exported. | 456 studies, series and/or instances) to be exported. |
353 | 457 |
354 Remark 1: Additional HTTP headers can be added with an optional | 458 Additional HTTP headers can be added with an optional ``HttpHeaders`` |
355 ``HttpHeaders`` argument as for QIDO-RS and WADO-RS. This might be | 459 argument as for QIDO-RS and WADO-RS. This might be useful e.g. for |
356 useful e.g. for cookie-based session management. | 460 cookie-based session management. |
357 | 461 |
358 Remark 2: One call to this ``.../stow`` primitive will possibly result | 462 Internally, this call results in creating an :ref:`Orthanc job <job>` |
359 in several HTTP requests to the DICOMweb server, in order to limit the | 463 that is executed synchronously (the REST call only returns once the |
360 size of the HTTP messages. The configuration options | 464 STOW-RS request is finished). You can run the job in asynchronous |
361 ``DicomWeb.StowMaxInstances`` and ``DicomWeb.StowMaxSize`` can be used | 465 mode as follows:: |
362 to tune this behavior (set both options to 0 to send one single | 466 |
363 request). | 467 $ curl http://localhost:8042/dicom-web/servers/sample/stow -X POST -d @- << EOF |
468 { | |
469 "Resources" : [ | |
470 "6ca4c9f3-5e895cb3-4d82c6da-09e060fe-9c59f228" | |
471 ], | |
472 "Synchronous" : false, | |
473 "Priority" : 10 | |
474 } | |
475 EOF | |
476 | |
477 { | |
478 "ID" : "a7bd2a5c-291d-4ca5-977a-66502cab22a1", | |
479 "Path" : ".././../jobs/a7bd2a5c-291d-4ca5-977a-66502cab22a1" | |
480 } | |
481 | |
482 Such a call ends immediately, and returns the ID of the job created by | |
483 Orthanc. The :ref:`status of the job <jobs-monitoring>` can then be | |
484 monitored using the Orthanc REST API. | |
485 | |
364 | 486 |
365 | 487 |
366 Retrieving DICOM resources from a WADO-RS server | 488 Retrieving DICOM resources from a WADO-RS server |
367 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 489 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
368 | 490 |
369 .. highlight:: text | 491 .. highlight:: bash |
370 | 492 |
371 Once DICOM resources of interest have been identified through a | 493 Once DICOM resources of interest have been identified through a |
372 QIDO-RS call to a remote DICOMweb server (cf. above), it is | 494 QIDO-RS call to a remote DICOMweb server (cf. above), it is |
373 interesting to download them locally with a WADO-RS call. You could do | 495 interesting to download them locally with a WADO-RS call. You could do |
374 it manually with a second call to the | 496 it manually with a second call to the |
375 ``/{dicom-web-root}/servers/{name}/get`` URI, but Orthanc provides | 497 ``/{dicom-web-root}/servers/{name}/get`` URI, but Orthanc provides |
376 another primitive ``.../retrieve`` to automate this process. | 498 another primitive ``.../retrieve`` to automate this process, in order |
499 to avoid the manual parsing of the multipart stream. | |
377 | 500 |
378 Here is how you would download one study, one series and one instance | 501 Here is how you would download one study, one series and one instance |
379 whose StudyInstanceUID (0020,000d), SeriesInstanceUID (0020,000e) are | 502 whose StudyInstanceUID (0020,000d), SeriesInstanceUID (0020,000e) are |
380 SOPInstanceUID (0008,0018) have been identified through a former | 503 SOPInstanceUID (0008,0018) have been identified through a former |
381 QIDO-RS call:: | 504 QIDO-RS call:: |
382 | 505 |
383 # curl http://localhost:8042/dicom-web/servers/sample/retrieve -X POST -d @- << EOF | 506 $ curl http://localhost:8042/dicom-web/servers/sample/retrieve -X POST -d @- << EOF |
384 { | 507 { |
385 "Resources" : [ | 508 "Resources" : [ |
386 { | 509 { |
387 "Study" : "1.3.51.0.1.1.192.168.29.133.1688840.1688819" | 510 "Study" : "1.3.51.0.1.1.192.168.29.133.1688840.1688819" |
388 }, | 511 }, |
405 Remark 1: Contrarily to the ``.../stow`` URI that uses :ref:`Orthanc | 528 Remark 1: Contrarily to the ``.../stow`` URI that uses :ref:`Orthanc |
406 identifiers <orthanc-ids>`, the ``.../retrieve`` URI uses DICOM | 529 identifiers <orthanc-ids>`, the ``.../retrieve`` URI uses DICOM |
407 identifiers. | 530 identifiers. |
408 | 531 |
409 Remark 2: The ``HttpHeaders`` and ``Arguments`` arguments are also | 532 Remark 2: The ``HttpHeaders`` and ``Arguments`` arguments are also |
410 available, as for QIDO-RS. | 533 available, as for QIDO-RS, to fine-tune the parameters of the WADO-RS |
534 request. | |
535 | |
536 Remark 3: As for QIDO-RS, the request is run synchronously by default. | |
537 The ``Synchronous`` and ``Priority`` arguments can be used to | |
538 asynchronously run the request. | |
411 | 539 |
412 | 540 |
413 | 541 |
414 Additional samples | 542 Additional samples |
415 ------------------ | 543 ------------------ |
418 are available for `Python | 546 are available for `Python |
419 <https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/Samples/Python/>`__ | 547 <https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/Samples/Python/>`__ |
420 and for `JavaScript | 548 and for `JavaScript |
421 <https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/Samples/JavaScript>`__. | 549 <https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/Samples/JavaScript>`__. |
422 | 550 |
423 Some integration tests are also `available separately | 551 Integration tests are `available separately |
424 <https://bitbucket.org/sjodogne/orthanc-tests/src/default/Plugins/DicomWeb/Run.py>`__ | 552 <https://bitbucket.org/sjodogne/orthanc-tests/src/default/Plugins/DicomWeb/Run.py>`__, |
425 (work in progress). | 553 and provide samples for more advanced features of the REST API (such |
554 as dynamically adding/updating/removing remote DICOMweb servers using | |
555 HTTP PUT and DELETE methods). |