Mercurial > hg > orthanc-book
annotate Sphinx/source/users/rest.rst @ 607:eaa6cdfa7ba6 Orthanc-1.9.0
Orthanc 1.9.0
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 29 Jan 2021 12:26:47 +0100 |
parents | 7d27154e70f9 |
children | 0dde82745e0d |
rev | line source |
---|---|
0 | 1 .. _rest: |
2 | |
3 REST API of Orthanc | |
4 =================== | |
5 | |
6 .. contents:: | |
7 :depth: 3 | |
8 | |
9 One of the major strengths of Orthanc lies in its built-in `RESTful | |
10 API | |
11 <https://en.wikipedia.org/wiki/Representational_state_transfer>`__, | |
12 that can be used to drive Orthanc from external applications, | |
13 independently of the programming language that is used to develop | |
14 these applications. The REST API of Orthanc gives a full programmatic | |
15 access to all the core features of Orthanc. | |
16 | |
17 Importantly, Orthanc Explorer (the embedded administrative interface | |
18 of Orthanc) entirely resorts to this REST API for all its features. | |
19 This implies that anything that can be done through Orthanc Explorer, | |
20 can also be done through REST queries. | |
21 | |
22 *Note:* All the examples are illustrated with the `cURL command-line | |
25 | 23 tool <https://curl.haxx.se/>`__, but equivalent calls can be readily |
0 | 24 transposed to any programming language that supports both HTTP and |
25 JSON. | |
26 | |
27 | |
114 | 28 .. _sending-dicom-images: |
29 | |
0 | 30 Sending DICOM images |
31 -------------------- | |
32 | |
33 .. highlight:: bash | |
34 | |
35 The upload of DICOM files is possible by querying the REST API using | |
36 the following syntax:: | |
37 | |
38 $ curl -X POST http://localhost:8042/instances --data-binary @CT.X.1.2.276.0.7230010.dcm | |
39 | |
40 .. highlight:: json | |
41 | |
42 Orthanc will respond with a JSON file that contain information about | |
43 the location of the stored instance, such as:: | |
44 | |
45 { | |
46 "ID" : "e87da270-c52b-4f2a-b8c6-bae25928d0b0", | |
47 "Path" : "/instances/e87da270-c52b-4f2a-b8c6-bae25928d0b0", | |
48 "Status" : "Success" | |
49 } | |
50 | |
51 .. highlight:: bash | |
52 | |
53 Note that in the case of curl, setting the ``Expect`` HTTP Header will | |
54 significantly `reduce the execution time of POST requests | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
331
diff
changeset
|
55 <https://stackoverflow.com/questions/463144/php-http-post-fails-when-curl-data-1024/463277#463277>`__:: |
0 | 56 |
57 $ curl -X POST -H "Expect:" http://localhost:8042/instances --data-binary @CT.X.1.2.276.0.7230010.dcm | |
58 | |
59 The code distribution of Orthanc contains a `sample Python script | |
449 | 60 <https://hg.orthanc-server.com/orthanc/file/default/OrthancServer/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py>`__ |
0 | 61 that recursively upload the content of some folder into Orthanc using |
62 the REST API:: | |
63 | |
64 $ python ImportDicomFiles.py localhost 8042 ~/DICOM/ | |
65 | |
66 | |
297
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
67 .. highlight:: perl |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
68 |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
69 If you are using Powershell (>= 3.0), you can use the following to send a single |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
70 Dicom instance to Orthanc:: |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
71 |
376 | 72 # disabling the progress bar makes the Invoke-RestMethod call MUCH faster |
297
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
73 $ProgressPreference = 'SilentlyContinue' |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
74 |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
75 # upload it to Orthanc |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
76 $reply = Invoke-RestMethod http://localhost:8042/instances -Method POST -InFile CT.X.1.2.276.0.7230010.dcm |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
77 |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
78 # display the result |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
79 Write-Host "The instance can be retrieved at http://localhost:8042$($reply.Path)" |
64d1ddab8246
Improved PDF creation Pwsh snippet + added Dicom instance upload example with
Benjamin Golinvaux <bgo@osimis.io>
parents:
294
diff
changeset
|
80 |
0 | 81 .. _rest-access: |
82 | |
83 Accessing the content of Orthanc | |
84 -------------------------------- | |
85 | |
86 Orthanc structures the stored DICOM resources using the "Patient, | |
87 Study, Series, Instance" model of the DICOM standard. Each DICOM | |
88 resource is associated with an :ref:`unique identifier <orthanc-ids>`. | |
89 | |
90 List all the DICOM resources | |
91 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
92 | |
93 Here is how you would list all the DICOM resources that are stored in | |
94 your local Orthanc instance:: | |
95 | |
96 $ curl http://localhost:8042/patients | |
97 $ curl http://localhost:8042/studies | |
98 $ curl http://localhost:8042/series | |
99 $ curl http://localhost:8042/instances | |
100 | |
101 Note that the result of this command is a `JSON file | |
25 | 102 <https://en.wikipedia.org/wiki/Json>`__ that contains an array of |
0 | 103 resource identifiers. The JSON file format is lightweight and can be |
104 parsed from almost any computer language. | |
105 | |
106 Accessing a patient | |
107 ^^^^^^^^^^^^^^^^^^^ | |
108 | |
109 .. highlight:: bash | |
110 | |
111 To access a single resource, add its identifier to the `URI | |
25 | 112 <https://en.wikipedia.org/wiki/Uniform_resource_identifier>`__. You |
0 | 113 would for instance retrieve the main information about one patient as |
114 follows:: | |
115 | |
116 $ curl http://localhost:8042/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94 | |
117 | |
118 .. highlight:: json | |
119 | |
120 Here is a possible answer from Orthanc:: | |
121 | |
122 { | |
123 "ID" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea", | |
124 "MainDicomTags" : { | |
125 "OtherPatientIDs" : "(null)", | |
126 "PatientBirthDate" : "0", | |
127 "PatientID" : "000000185", | |
128 "PatientName" : "Anonymous^Unknown", | |
129 "PatientSex" : "O" | |
130 }, | |
131 "Studies" : [ "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15" ], | |
132 "Type" : "Patient" | |
133 } | |
134 | |
135 This is once again a JSON file. Note how Orthanc gives you a summary | |
136 of the main DICOM tags that correspond to the patient level. | |
137 | |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
138 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
139 .. _browsing-hierarchy: |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
140 |
0 | 141 Browsing from the patient down to the instance |
142 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
143 | |
144 .. highlight:: bash | |
145 | |
146 The field ``Studies`` list all the DICOM studies that are associated | |
147 with the patient. So, considering the patient above, we would go down | |
148 in her DICOM hierarchy as follows:: | |
149 | |
150 $ curl http://localhost:8042/studies/9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15 | |
151 | |
152 .. highlight:: json | |
153 | |
154 And Orthanc could answer:: | |
155 | |
156 { | |
157 "ID" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15", | |
158 "MainDicomTags" : { | |
159 "AccessionNumber" : "(null)", | |
160 "StudyDate" : "20120716", | |
161 "StudyDescription" : "TestSUVce-TF", | |
162 "StudyID" : "23848", | |
163 "StudyInstanceUID" : "1.2.840.113704.1.111.7016.1342451220.40", | |
164 "StudyTime" : "170728" | |
165 }, | |
166 "ParentPatient" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea", | |
167 "Series" : [ | |
168 "6821d761-31fb55a9-031ebecb-ba7f9aae-ffe4ddc0", | |
169 "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", | |
170 "7384c47e-6398f2a8-901846ef-da1e2e0b-6c50d598" | |
171 ], | |
172 "Type" : "Study" | |
173 } | |
174 | |
175 .. highlight:: bash | |
176 | |
177 The main DICOM tags are now those that are related to the study | |
178 level. It is possible to retrieve the identifier of the patient in the | |
179 ``ParentPatient`` field, which can be used to go upward the DICOM | |
180 hierarchy. But let us rather go down to the series level by using the | |
181 ``Series`` array. The next command would return information about one | |
182 of the three series that have just been reported:: | |
183 | |
184 $ curl http://localhost:8042/series/2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35 | |
185 | |
186 .. highlight:: json | |
187 | |
188 Here is a possible answer:: | |
189 | |
190 { | |
191 "ExpectedNumberOfInstances" : 45, | |
192 "ID" : "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", | |
193 "Instances" : [ | |
194 "41bc3f74-360f9d10-6ae9ffa4-01ea2045-cbd457dd", | |
195 "1d3de868-6c4f0494-709fd140-7ccc4c94-a6daa3a8", | |
196 <...> | |
197 "1010f80b-161b71c0-897ec01b-c85cd206-e669a3ea", | |
198 "e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4" | |
199 ], | |
200 "MainDicomTags" : { | |
201 "Manufacturer" : "Philips Medical Systems", | |
202 "Modality" : "PT", | |
203 "NumberOfSlices" : "45", | |
204 "ProtocolName" : "CHU/Body_PET/CT___50", | |
205 "SeriesDate" : "20120716", | |
206 "SeriesDescription" : "[WB_CTAC] Body", | |
207 "SeriesInstanceUID" : "1.3.46.670589.28.2.12.30.26407.37145.2.2516.0.1342458737", | |
208 "SeriesNumber" : "587370", | |
209 "SeriesTime" : "171121", | |
210 "StationName" : "r054-svr" | |
211 }, | |
212 "ParentStudy" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15", | |
213 "Status" : "Complete", | |
214 "Type" : "Series" | |
215 } | |
216 | |
217 It can be seen that this series comes from a PET modality. Orthanc has | |
218 computed that this series should contain 45 instances. | |
219 | |
220 .. highlight:: bash | |
221 | |
222 So far, we have navigated from the patient level, to the study level, | |
223 and finally to the series level. There only remains the instance | |
224 level. Let us dump the content of one of the instances:: | |
225 | |
226 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4 | |
227 | |
228 .. highlight:: json | |
229 | |
230 The instance contains the following information:: | |
231 | |
232 { | |
233 "FileSize" : 70356, | |
234 "FileUuid" : "3fd265f0-c2b6-41a2-ace8-ae332db63e06", | |
235 "ID" : "e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4", | |
236 "IndexInSeries" : 6, | |
237 "MainDicomTags" : { | |
238 "ImageIndex" : "6", | |
239 "InstanceCreationDate" : "20120716", | |
240 "InstanceCreationTime" : "171344", | |
241 "InstanceNumber" : "6", | |
242 "SOPInstanceUID" : "1.3.46.670589.28.2.15.30.26407.37145.3.2116.39.1342458737" | |
243 }, | |
244 "ParentSeries" : "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", | |
245 "Type" : "Instance" | |
246 } | |
247 | |
248 .. highlight:: bash | |
249 | |
250 The instance has the index 6 in the parent series. The instance is | |
251 stored as a raw DICOM file of 70356 bytes. You would download this | |
252 DICOM file using the following command:: | |
253 | |
254 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/file > Instance.dcm | |
255 | |
256 | |
257 Accessing the DICOM fields of an instance as a JSON file | |
258 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
259 | |
260 .. highlight:: bash | |
261 | |
262 When one gets to the instance level, you can retrieve the hierarchy of | |
263 all the DICOM tags of this instance as a JSON file:: | |
264 | |
265 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/simplified-tags | |
266 | |
267 .. highlight:: json | |
268 | |
269 Here is a excerpt of the Orthanc answer:: | |
270 | |
271 { | |
272 "ACR_NEMA_2C_VariablePixelDataGroupLength" : "57130", | |
273 "AccessionNumber" : null, | |
274 "AcquisitionDate" : "20120716", | |
275 "AcquisitionDateTime" : "20120716171219", | |
276 "AcquisitionTime" : "171219", | |
277 "ActualFrameDuration" : "3597793", | |
278 "AttenuationCorrectionMethod" : "CTAC-SG", | |
279 <...> | |
280 "PatientID" : "000000185", | |
281 "PatientName" : "Anonymous^Unknown", | |
282 "PatientOrientationCodeSequence" : [ | |
283 { | |
284 "CodeMeaning" : "recumbent", | |
285 "CodeValue" : "F-10450", | |
286 "CodingSchemeDesignator" : "99SDM", | |
287 "PatientOrientationModifierCodeSequence" : [ | |
288 { | |
289 "CodeMeaning" : "supine", | |
290 "CodeValue" : "F-10340", | |
291 "CodingSchemeDesignator" : "99SDM" | |
292 } | |
293 ] | |
294 } | |
295 ], | |
296 <...> | |
297 "StudyDescription" : "TestSUVce-TF", | |
298 "StudyID" : "23848", | |
299 "StudyInstanceUID" : "1.2.840.113704.1.111.7016.1342451220.40", | |
300 "StudyTime" : "171117", | |
301 "TypeOfDetectorMotion" : "NONE", | |
302 "Units" : "BQML", | |
303 "Unknown" : null, | |
304 "WindowCenter" : "1.496995e+04", | |
305 "WindowWidth" : "2.993990e+04" | |
306 } | |
307 | |
308 .. highlight:: bash | |
309 | |
310 If you need more detailed information about the type of the variables | |
311 or if you wish to use the hexadecimal indexes of DICOM tags, you are | |
312 free to use the following URL:: | |
313 | |
314 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/tags | |
315 | |
316 Accessing the raw DICOM fields of an instance | |
317 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
318 | |
319 .. highlight:: bash | |
320 | |
321 You also have the opportunity to access the raw value of the DICOM | |
322 tags of an instance, without going through a JSON file. Here is how | |
323 you would find the Patient Name of the instance:: | |
324 | |
325 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content/0010-0010 | |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
326 Anonymous^Unknown |
0 | 327 |
328 The list of all the available tags for this instance can also be retrieved easily:: | |
329 | |
330 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content | |
331 | |
332 It is also possible to recursively explore the sequences of tags:: | |
333 | |
334 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content/0008-1250/0/0040-a170/0/0008-0104 | |
335 For Attenuation Correction | |
336 | |
337 The command above has opened the "0008-1250" tag that is a DICOM | |
338 sequence, taken its first child, opened its "0040-a170" tag that is | |
339 also a sequence, taken the first child of this child, and returned the | |
340 "0008-0104" DICOM tag. | |
341 | |
342 Downloading images | |
343 ^^^^^^^^^^^^^^^^^^ | |
344 | |
345 .. highlight:: bash | |
346 | |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
347 As :ref:`explained above <browsing-hierarchy>`, the raw DICOM file |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
348 corresponding to a single instance can be retrieved as follows:: |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
349 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
350 $ curl http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/file > Instance.dcm |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
351 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
352 It is also possible to download a preview PNG image that corresponds |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
353 to some DICOM instance:: |
0 | 354 |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
355 $ curl http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/preview > Preview.png |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
356 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
357 The resulting image will be a standard graylevel PNG image (with 8 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
358 bits per pixel) that can be opened by any painting software. The |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
359 dynamic range of the pixel data is stretched to the [0..255] range. |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
360 An equivalent JPEG image can be downloaded by setting the `HTTP header |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
361 <https://en.wikipedia.org/wiki/List_of_HTTP_header_fields>`__ |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
362 ``Accept`` to ``image/jpeg``:: |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
363 |
169 | 364 $ curl -H 'Accept: image/jpeg' http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/preview > Preview.jpg |
0 | 365 |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
366 If you don't want to stretch the dynamic range, and create a 8bpp or |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
367 16bpp PNG image, you can use the following URIs:: |
0 | 368 |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
369 $ curl http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/image-uint8 > full-8.png |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
370 $ curl http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/image-uint16 > full-16.png |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
371 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
372 In these images, the values are cropped to the maximal value that can |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
373 be encoded by the target image format. The |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
374 ``/instances/{...}/image-int16`` is available as well to download |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
375 signed DICOM pixel data. |
0 | 376 |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
377 Since Orthanc 1.4.2, it is also possible to download such images in |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
378 the generic `PAM format |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
379 <https://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format>`__:: |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
380 |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
381 $ curl -H 'Accept: image/x-portable-arbitrarymap' http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/image-uint16 > full-16.pam |
0 | 382 |
168
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
383 Users of Matlab or Octave can find related information :ref:`in the |
86e92d0cc53e
information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
155
diff
changeset
|
384 dedicated section <matlab>`. |
0 | 385 |
380 | 386 Downloading studies |
411 | 387 ^^^^^^^^^^^^^^^^^^^ |
380 | 388 |
389 .. highlight:: bash | |
390 | |
391 All instances of a study can be retrieved as a zip file as follows:: | |
392 | |
393 $ curl http://localhost:8042/studies/6b9e19d9-62094390-5f9ddb01-4a191ae7-9766b715/archive > Study.zip | |
394 | |
395 It is also possible to download a zipped DICOMDIR through:: | |
396 | |
381 | 397 $ curl http://localhost:8042/studies/6b9e19d9-62094390-5f9ddb01-4a191ae7-9766b715/media > Study.zip |
380 | 398 |
218 | 399 |
400 .. _peering: | |
401 | |
216 | 402 Sending resources to remote Orthanc over HTTP/HTTPS (through Orthanc peering) |
224
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
223
diff
changeset
|
403 ----------------------------------------------------------------------------- |
216 | 404 |
428
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
405 Orthanc can send its DICOM instances to remote Orthanc servers over |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
406 HTTP/HTTPS. Such servers are referred to as :ref:`Orthanc peers |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
407 <peers>`. This process can be triggered by the REST API, which is |
943515b68158
documented transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
408 described in this section. |
216 | 409 |
410 Configuration | |
411 ^^^^^^^^^^^^^ | |
412 | |
413 .. highlight:: json | |
414 | |
314
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
415 You first have to declare the Url of the remote orthanc inside the |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
416 :ref:`configuration file <configuration>`. For instance, here is how |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
417 to declare a remote orthanc peer:: |
216 | 418 |
419 ... | |
494 | 420 "OrthancPeers" : { |
216 | 421 "sample" : [ "http://localhost:8043" ], // short version |
422 "sample2" : { // long version | |
423 "Url" : "http://localhost:8044", | |
424 "Username" : "alice", // optional | |
425 "Password" : "alicePassword", // optional | |
426 "HttpHeaders" : { "Token" : "Hello world" }, // optional | |
427 "CertificateFile" : "client.crt", // optional (only if using client certificate authentication) | |
428 "CertificateKeyFile" : "client.key", // optional (only if using client certificate authentication) | |
429 "CertificateKeyPassword" : "certpass" // optional (only if using client certificate authentication) | |
430 }, | |
431 ... | |
432 | |
433 .. highlight:: bash | |
434 | |
435 Such a configuration would enable Orthanc to connect to two other | |
436 Orthanc instances that listens on the | |
437 localhost on the port 8043 & 8044. The peers that are known to Orthanc | |
438 can be queried:: | |
439 | |
440 $ curl http://localhost:8042/peers?expand | |
441 | |
442 The peers can then be updated through the API too:: | |
443 | |
444 $ curl -v -X PUT http://localhost:8042/peers/sample -d '{"Url" : "http://127.0.0.1:8043"}' | |
445 | |
446 | |
447 Note that, by default, peers are stored in Orthanc configuration files | |
448 and are updated in Orthanc memory only. If you want your modifications | |
449 to be persistent, you should configure Orthanc to store its peers | |
450 in the database. This is done through this configuration:: | |
0 | 451 |
216 | 452 ... |
453 "OrthancPeersInDatabase" : true, | |
454 ... | |
455 | |
456 Sending One Resource | |
457 ^^^^^^^^^^^^^^^^^^^^ | |
458 | |
459 .. highlight:: bash | |
460 | |
461 Once you have identified the Orthanc identifier of the DICOM resource | |
462 that would like to send :ref:`as explained above <rest-access>`, you | |
463 would use the following command to send it:: | |
464 | |
465 $ curl -X POST http://localhost:8042/peers/sample/store -d c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f | |
466 | |
467 The ``/sample/`` component of the URI corresponds to the identifier of | |
468 the remote modality, as specified above in the configuration file. | |
469 | |
470 Note that you can send isolated DICOM instances with this command, but | |
471 also entire patients, studies or series. It is possible to send multiple instances with a single POST | |
472 request:: | |
473 | |
474 $ curl -X POST http://localhost:8042/peers/sample/store -d '["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88","d5604121-7d613ce6-c315a5-a77b3cf3-9c253b23","cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e"]' | |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
475 |
216 | 476 Note that the list of resources to be sent can include the |
477 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients, | |
478 studies or series as well. | |
479 | |
294 | 480 Testing connectivity with a remote peer |
481 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
482 | |
483 .. highlight:: bash | |
484 | |
485 In version 1.5.9+, we have introduced a route to retrieve the ``/system`` info from | |
486 a remote peer. This route can also be used to test the connectivity with that peer | |
487 without actually sending a DICOM resource.:: | |
488 | |
489 $ curl http://localhost:8042/peers/sample/system | |
490 | |
491 | |
216 | 492 Using HTTPS |
493 ^^^^^^^^^^^ | |
494 | |
495 If you're transfering medical data over internet, it is mandatory to use HTTPS. | |
496 | |
497 On the server side, we recommend to put Orthanc behing an :ref:`HTTPS server that will take care of the TLS <https>`. | |
498 | |
499 On the client side, in order for the client Orthanc to recognize the server certificate, you'll have to provide a path | |
500 to the CA (certification authority) certificates. This is done in the configuration file through this configurationg:: | |
501 | |
502 ... | |
503 "HttpsCACertificates" : "/etc/ssl/certs/ca-certificates.crt, | |
504 ... | |
505 | |
223 | 506 If you want your server to accept incoming connections for known hosts only, you can either: |
216 | 507 |
508 - configure a firewall to accept incoming connections from known IP addresses | |
509 - configure your client Orthanc to use a client certificate to authenticate at the Server. This is done through the ``CertificateFile``, ``CertificateKeyFile`` and ``CertificateKeyPassword`` entries in the configuration file. | |
510 | |
511 | |
512 | |
513 | |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
514 Sending resources to remote modalities (through DICOM C-Store) |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
515 -------------------------------------------------------------- |
0 | 516 |
517 Orthanc can send its DICOM instances to remote DICOM modalities (C-Store SCU). This process | |
518 can be triggered by the REST API. | |
519 | |
520 Configuration | |
521 ^^^^^^^^^^^^^ | |
522 | |
523 .. highlight:: json | |
524 | |
525 You first have to declare the AET, the IP address and the port number | |
526 of the remote modality inside the :ref:`configuration file | |
527 <configuration>`. For instance, here is how to declare a remote | |
528 modality:: | |
529 | |
530 ... | |
531 "DicomModalities" : { | |
212 | 532 "sample" : [ "ORTHANCA", "127.0.0.1", 2000 ], // short version |
533 "sample2" : { // long version | |
534 "AET" : "ORTHANCB", | |
535 "Port" : 2001, | |
536 "Host" : "127.0.0.1", | |
537 "Manufacturer" : "Generic", | |
538 "AllowEcho" : true, | |
539 "AllowFind" : true, | |
540 "AllowMove" : true, | |
541 "AllowStore" : true | |
542 } | |
0 | 543 }, |
544 ... | |
545 | |
546 .. highlight:: bash | |
547 | |
212 | 548 Such a configuration would enable Orthanc to connect to two DICOM |
549 stores (for instance, other Orthanc instances) that listens on the | |
550 localhost on the port 2000 & 2001. The modalities that are known to Orthanc | |
0 | 551 can be queried:: |
552 | |
212 | 553 $ curl http://localhost:8042/modalities?expand |
554 | |
555 The modalities can then be updated through the API too:: | |
556 | |
557 $ curl -v -X PUT http://localhost:8042/modalities/sample -d '{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}' | |
558 | |
0 | 559 |
212 | 560 Note that, by default, modalities are stored in Orthanc configuration files |
561 and are updated in Orthanc memory only. If you want your modifications | |
562 to be persistent, you should configure Orthanc to store its modalities | |
563 in the database. This is done through this configuration:: | |
564 | |
565 ... | |
566 "DicomModalitiesInDatabase" : true, | |
567 ... | |
0 | 568 |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
314
diff
changeset
|
569 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
314
diff
changeset
|
570 .. _rest-store-scu: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
314
diff
changeset
|
571 |
0 | 572 Sending One Resource |
573 ^^^^^^^^^^^^^^^^^^^^ | |
574 | |
575 .. highlight:: bash | |
576 | |
577 Once you have identified the Orthanc identifier of the DICOM resource | |
578 that would like to send :ref:`as explained above <rest-access>`, you | |
579 would use the following command to send it:: | |
580 | |
581 $ curl -X POST http://localhost:8042/modalities/sample/store -d c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f | |
582 | |
583 The ``/sample/`` component of the URI corresponds to the identifier of | |
584 the remote modality, as specified above in the configuration file. | |
585 | |
173
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
586 Note that you can send isolated DICOM instances with this command, but |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
587 also entire patients, studies or series. |
0 | 588 |
407 | 589 Various optional fields are also available. i.e, if you need to |
590 monitor the state of a transfer, you can start the transfer in :ref:`asynchronous mode | |
591 <jobs>`, which will provide you with the identifier of the Orthanc job:: | |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
592 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
593 $ curl -X POST http://localhost:8042/modalities/sample/store \ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
594 --data '{ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
595 "Resources" : ["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88"], |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
596 "Synchronous" : false, |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
597 "LocalAet" : "ORTHANC", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
598 "MoveOriginatorAet": "ORTHANC", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
599 "MoveOriginatorID": 1234, |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
600 "Timeout": 10, |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
601 "StorageCommitment": false |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
602 }' |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
603 |
403 | 604 |
0 | 605 Bulk Store SCU |
606 ^^^^^^^^^^^^^^ | |
607 | |
608 .. highlight:: bash | |
609 | |
610 Each time a POST request is made to ``/modalities/.../store``, a new | |
173
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
611 DICOM association is possibly established. This may lead to a large |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
612 communication overhead if sending multiple isolated instances by |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
613 making one REST call for each of these instances. |
0 | 614 |
615 To circumvent this problem, you have 2 possibilities: | |
616 | |
617 1. Set the ``DicomAssociationCloseDelay`` option in the | |
618 :ref:`configuration file <configuration>` to a non-zero value. This | |
619 will keep the DICOM connection open for a certain amount of time, | |
173
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
620 waiting for new instances to be routed. This is useful if |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
621 autorouting images :ref:`using Lua <lua-auto-routing>`. |
0 | 622 |
173
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
623 2. It is possible to send multiple instances with a single POST |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
624 request (so-called "Bulk Store SCU", available from Orthanc |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
625 0.5.2):: |
0 | 626 |
627 $ curl -X POST http://localhost:8042/modalities/sample/store -d '["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88","d5604121-7d613ce6-c315a5-a77b3cf3-9c253b23","cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e"]' | |
628 | |
629 The list of the resources to be sent are given as a JSON array. In | |
630 this case, a single DICOM connection is used. `Sample code is | |
631 available | |
449 | 632 <https://hg.orthanc-server.com/orthanc/file/default/OrthancServer/Resources/Samples/Python/HighPerformanceAutoRouting.py>`__. |
0 | 633 |
173
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
634 Note that the list of resources to be sent can include the |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
635 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients, |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
636 studies or series as well. |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
637 |
901bc7b2dbab
improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
169
diff
changeset
|
638 |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
639 Performing C-Echo |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
640 ----------------- |
0 | 641 |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
642 To validate the DICOM connectivity between Orthanc and a remote modality, |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
643 you can perform a C-ECHO:: |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
644 |
557
3af5dda67520
fix sample for c-echo in rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
494
diff
changeset
|
645 $ curl -X POST http://localhost:8042/modalities/sample/echo -d '{}' |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
646 |
557
3af5dda67520
fix sample for c-echo in rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
494
diff
changeset
|
647 From Orthanc 1.7.0, you can include an extra ``Timeout`` field:: |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
648 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
649 $ curl -X POST http://localhost:8042/modalities/sample/echo -d '{ "Timeout": 10 }' |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
650 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
651 If no ``Timeout`` parameter is specified, the value of the ``DicomScuTimeout`` |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
652 configuration is used as a default. If ``Timeout`` is set to zero, this means |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
653 no timeout. |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
654 |
557
3af5dda67520
fix sample for c-echo in rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
494
diff
changeset
|
655 NB: A body containing a valid JSON object is needed by |
3af5dda67520
fix sample for c-echo in rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
494
diff
changeset
|
656 ``/modalities/{id}/echo`` since Orthanc 1.7.0. |
3af5dda67520
fix sample for c-echo in rest api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
494
diff
changeset
|
657 |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
658 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
659 Performing C-Move |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
660 ----------------- |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
661 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
662 .. highlight:: bash |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
663 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
664 You can perform a DICOM C-Move to move a specific study from one modality |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
665 to another (including Orthanc itself if you don't specify the ``TargetAet`` |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
666 field). |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
667 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
668 I.e. to move a study whose you know the ``StudyInstanceUID`` from |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
669 the modality ``sample`` to another Orthanc whose AET is ``ORTHANCB``:: |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
670 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
671 $ curl --request POST --url http://localhost:8042/modalities/samples/move \ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
672 --data '{ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
673 "Level" : "Study", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
674 "Resources" : [ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
675 { |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
676 "StudyInstanceUID": "1.2.840.113543.6.6.4.7.64067529866380271256212683512383713111129" |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
677 } |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
678 ], |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
679 "TargetAet": "ORTHANCB", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
680 "Timeout": 60 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
681 }' |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
682 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
683 |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
684 Performing Query/Retrieve (C-Find) and Find with REST |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
685 ----------------------------------------------------- |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
686 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
687 *Section contributed by Bryan Dearlove* |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
688 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
689 Orthanc can be used to perform queries on the local Orthanc instance, |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
690 or on remote modalities through the REST API. |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
691 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
692 To perform a query of a remote modality you must define the modality |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
693 within the :ref:`configuration file <configuration>` (See |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
694 Configuration section under Sending resources to remote modalities). |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
695 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
696 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
697 Performing Queries on Modalities |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
698 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
699 |
138 | 700 .. highlight:: bash |
701 | |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
702 To initiate a query you perform a POST command against the Modality |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
703 with the identifiers you are looking for. The the example below we are |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
704 performing a study level query against the modality sample for any |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
705 study descriptions with the word chest within it. This search is case |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
706 insensitive unless configured otherwise within the Orthanc |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
707 configuration file:: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
708 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
709 $ curl --request POST \ |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
710 --url http://localhost:8042/modalities/sample/query \ |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
711 --data '{ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
712 "Level" : "Study", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
713 "Query" : { |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
714 "PatientID" : "", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
715 "StudyDescription" : "*Chest*", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
716 "PatientName" : "" |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
717 } |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
718 }' |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
719 |
314
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
720 You might be interested in including the ``Normalize`` option to bypass |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
721 the normalization of the outgoing C-FIND queries. For instance, for |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
722 the ``InstitutionName`` to be included at the ``Study`` level, one would |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
723 run:: |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
724 |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
725 $ curl -v http://localhost:8042/modalities/sample/query -X POST -d \ |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
726 '{"Level":"Study","Query":{"InstitutionName":"a"},"Normalize":false}' |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
727 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
728 .. highlight:: json |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
729 |
138 | 730 You will receive back an ID which can be used to retrieve more |
731 information with GET commands or C-Move requests with a POST Command:: | |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
732 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
733 { |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
734 "ID": "5af318ac-78fb-47ff-b0b0-0df18b0588e0", |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
735 "Path": "/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0" |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
736 } |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
737 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
738 |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
739 Additional Options |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
740 ^^^^^^^^^^^^^^^^^^ |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
741 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
742 .. highlight:: json |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
743 |
314
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
744 You can use patient identifiers by including the ``*`` within your |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
745 search. For example if you were searching for a name beginning with |
314
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
746 ``Jones`` you can do:: |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
747 |
139 | 748 "PatientName":"Jones*" |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
749 |
314
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
750 If you wanted to search for a name with the words ``Jo`` anywhere |
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
751 within it you can do:: |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
752 |
139 | 753 "PatientName":"*Jo*" |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
754 |
138 | 755 To perform date searches you can specify within StudyDate a starting |
756 date and/or a before date. For example ``"StudyDate":"20180323-"`` | |
757 would search for all study dates after the specified date to | |
758 now. Doing ``"StudyDate":"20180323-20180325"`` would search for all | |
759 study dates between the specified date. | |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
760 |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
761 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
762 Reviewing Level |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
763 ^^^^^^^^^^^^^^^ |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
764 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
765 .. highlight:: bash |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
766 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
767 :: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
768 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
769 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/level |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
770 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
771 Will retrieve the level with which the query was performed, Study, |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
772 Series or Instance. |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
773 |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
774 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
775 Reviewing Modality |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
776 ^^^^^^^^^^^^^^^^^^ |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
777 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
778 .. highlight:: bash |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
779 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
780 :: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
781 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
782 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/modality |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
783 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
784 Will provide the modality name which the original query was performed against. |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
785 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
786 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
787 Reviewing Query |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
788 ^^^^^^^^^^^^^^^ |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
789 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
790 .. highlight:: bash |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
791 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
792 To retrieve information on what identifiers the query was originally |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
793 performed using you can use the query filter:: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
794 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
795 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/query |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
796 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
797 |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
798 Reviewing Query Answers |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
799 ^^^^^^^^^^^^^^^^^^^^^^^ |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
800 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
801 .. highlight:: bash |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
802 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
803 You are able to individually review each answer returned by performing |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
804 a GET with the answers parameter:: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
805 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
806 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
807 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
808 You will get a JSON back with numbered identifiers for each answer you |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
809 received back. For example because we performed a Study level query we |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
810 received back 5 studies answers back. We are able to query each answer |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
811 for content details:: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
812 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
813 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers/0/content |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
814 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
815 If there are content items missing, you may add them by adding that |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
816 identifier to the original query. For example if we wanted Modalities |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
817 listed in this JSON answer in the initial query we would add to the |
314
5f0cd51d97c0
Normalize option in /modalities/.../query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
313
diff
changeset
|
818 POST body: ``"ModalitiesInStudy":""`` |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
819 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
820 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
821 Performing Retrieve (C-Move) |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
822 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
823 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
824 .. highlight:: bash |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
825 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
826 You can perform a C-Move to retrieve all studies within the original |
205
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
827 query using a post command and identifying the Modality (named in this |
207 | 828 example ``Orthanc``), to be one to in the POST contents:: |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
829 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
830 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/retrieve --data Orthanc |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
831 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
832 You are also able to perform individual C-Moves for a content item by |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
833 specifying that individual content item:: |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
834 |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
835 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers/0/retrieve --data Orthanc |
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
836 |
207 | 837 If C-Moves take too long (for example, performing a C-Move of a big |
838 study), you may run the request in asynchronous fashion, which will | |
839 create a job in Orthanc:: | |
205
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
840 |
207 | 841 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/retrieve \ |
842 --data '{"TargetAet":"Orthanc","Synchronous":false}' | |
843 | |
205
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
844 |
207 | 845 .. highlight:: bash |
846 | |
847 The answer of this POST request is the job ID taking care of the C-Move:: | |
205
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
848 |
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
849 { |
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
850 "ID" : "11541b16-e368-41cf-a8e9-3acf4061d238", |
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
851 "Path" : "/jobs/11541b16-e368-41cf-a8e9-3acf4061d238" |
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
852 } |
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
853 |
7213bef30604
rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents:
173
diff
changeset
|
854 |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
855 |
378
16dc3561b41e
Filtering and returning metadata using Python
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
360
diff
changeset
|
856 .. _rest-find: |
16dc3561b41e
Filtering and returning metadata using Python
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
360
diff
changeset
|
857 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
858 Performing Finds within Orthanc |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
859 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
860 .. highlight:: bash |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
861 |
138 | 862 Performing a find within Orthanc is very similar to using Queries |
863 against DICOM modalities and the additional options listed above work | |
864 with find also. When performing a find, you will receive the Orthanc | |
865 ID's of all the matched items within your find. For example if you | |
866 perform a study level find and 5 Studies match you will receive 5 | |
867 study level Orthanc ID's in JSON format as a response:: | |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
868 |
404
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
869 $ curl --request POST --url http://localhost:8042/tools/find \ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
870 --data '{ |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
871 "Level" : "Instance", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
872 "Query" : { |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
873 "Modality" : "CR", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
874 "StudyDate" : "20180323-", |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
875 "PatientID" : "*" |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
876 } |
7469b6c5618b
DICOM commands: Timeout + improved existing doc
Alain Mazy <alain@mazy.be>
parents:
381
diff
changeset
|
877 }' |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
878 |
312
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
879 Setting the ``Expand`` field to ``true`` in the POST body of the |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
880 query will automatically report details about each study:: |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
881 |
313 | 882 $ curl https://demo.orthanc-server.com/tools/find -d '{"Level":"Study","Query":{"PatientName":"KNIX"}}' |
883 [ | |
884 "b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0" | |
885 ] | |
312
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
886 $ curl https://demo.orthanc-server.com/tools/find -d '{"Level":"Study","Query":{"PatientName":"KNIX"},"Expand":true}' |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
887 [ |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
888 { |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
889 "ID" : "b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
890 "IsStable" : true, |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
891 "LastUpdate" : "20180414T091528", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
892 "MainDicomTags" : { |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
893 "InstitutionName" : "0ECJ52puWpVIjTuhnBA0um", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
894 "ReferringPhysicianName" : "1", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
895 "StudyDate" : "20070101", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
896 "StudyDescription" : "Knee (R)", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
897 "StudyID" : "1", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
898 "StudyInstanceUID" : "1.2.840.113619.2.176.2025.1499492.7391.1171285944.390", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
899 "StudyTime" : "120000.000000" |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
900 }, |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
901 "ParentPatient" : "6816cb19-844d5aee-85245eba-28e841e6-2414fae2", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
902 "PatientMainDicomTags" : { |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
903 "PatientID" : "ozp00SjY2xG", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
904 "PatientName" : "KNIX" |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
905 }, |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
906 "Series" : [ |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
907 "20b9d0c2-97d85e07-f4dbf4d2-f09e7e6a-0c19062e", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
908 "edbfa0a9-fa2641d7-29514b1c-45881d0b-46c374bd", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
909 "f2635388-f01d497a-15f7c06b-ad7dba06-c4c599fe", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
910 "4d04593b-953ced51-87e93f11-ae4cf03c-25defdcd", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
911 "5e343c3e-3633c396-03aefde8-ba0e08c7-9c8208d3", |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
912 "8ea120d7-5057d919-837dfbcc-ccd04e0f-7f3a94aa" |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
913 ], |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
914 "Type" : "Study" |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
915 } |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
916 ] |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
917 |
b19b892977a2
expand in /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
297
diff
changeset
|
918 |
138 | 919 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
920 Additional Options |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
921 ^^^^^^^^^^^^^^^^^^ |
138 | 922 .. highlight:: json |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
923 |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
924 You also have the ability to limit the responses by specifying a limit within the body of the POST message. For example:: |
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
925 |
138 | 926 "Limit":4 |
136
8e08909ab69b
Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents:
132
diff
changeset
|
927 |
132
55a2ee3c462d
Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
928 |
216 | 929 .. _changes: |
930 | |
0 | 931 Tracking changes |
932 ---------------- | |
933 | |
934 .. highlight:: bash | |
935 | |
936 Whenever Orthanc receives a new DICOM instance, this event is recorded | |
937 in the so-called "Changes Log". This enables remote scripts to react | |
938 to the arrival of new DICOM resources. A typical application is | |
939 **auto-routing**, where an external script waits for a new DICOM | |
940 instance to arrive into Orthanc, then forward this instance to another | |
941 modality. | |
942 | |
943 The Changes Log can be accessed by the following command:: | |
944 | |
945 $ curl http://localhost:8042/changes | |
946 | |
947 .. highlight:: json | |
948 | |
949 Here is a typical output:: | |
950 | |
951 { | |
952 "Changes" : [ | |
953 { | |
954 "ChangeType" : "NewInstance", | |
955 "Date" : "20130507T143902", | |
956 "ID" : "8e289db9-0e1437e1-3ecf395f-d8aae463-f4bb49fe", | |
957 "Path" : "/instances/8e289db9-0e1437e1-3ecf395f-d8aae463-f4bb49fe", | |
958 "ResourceType" : "Instance", | |
959 "Seq" : 921 | |
960 }, | |
961 { | |
962 "ChangeType" : "NewSeries", | |
963 "Date" : "20130507T143902", | |
964 "ID" : "cceb768f-e0f8df71-511b0277-07e55743-9ef8890d", | |
965 "Path" : "/series/cceb768f-e0f8df71-511b0277-07e55743-9ef8890d", | |
966 "ResourceType" : "Series", | |
967 "Seq" : 922 | |
968 }, | |
969 { | |
970 "ChangeType" : "NewStudy", | |
971 "Date" : "20130507T143902", | |
972 "ID" : "c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f", | |
973 "Path" : "/studies/c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f", | |
974 "ResourceType" : "Study", | |
975 "Seq" : 923 | |
976 }, | |
977 { | |
978 "ChangeType" : "NewPatient", | |
979 "Date" : "20130507T143902", | |
980 "ID" : "dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94", | |
981 "Path" : "/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94", | |
982 "ResourceType" : "Patient", | |
983 "Seq" : 924 | |
984 } | |
985 ], | |
986 "Done" : true, | |
987 "Last" : 924 | |
988 } | |
989 | |
990 This output corresponds to the receiving of one single DICOM instance | |
991 by Orthanc. It records that a new instance, a new series, a new study | |
992 and a new patient has been created inside Orthanc. Note that each | |
993 changes is labeled by a ``ChangeType``, a ``Date`` (in the `ISO format | |
25 | 994 <https://en.wikipedia.org/wiki/ISO_8601>`__), the location of the |
0 | 995 resource inside Orthanc, and a sequence number (``Seq``). |
996 | |
997 Note that this call is non-blocking. It is up to the calling program | |
998 to wait for the occurrence of a new event (by implementing a polling | |
999 loop). | |
1000 | |
1001 .. highlight:: bash | |
1002 | |
1003 This call only returns a fixed number of events, that can be changed | |
1004 by using the ``limit`` option:: | |
1005 | |
1006 $ curl http://localhost:8042/changes?limit=100 | |
1007 | |
1008 The flag ``Last`` records the sequence number of the lastly returned | |
1009 event. The flag ``Done`` is set to ``true`` if no further event has | |
1010 occurred after this lastly returned event. If ``Done`` is set to | |
1011 ``false``, further events are available and can be retrieved. This is | |
1012 done by setting the ``since`` option that specifies from which | |
1013 sequence number the changes must be returned:: | |
1014 | |
1015 $ curl 'http://localhost:8042/changes?limit=100&since=922' | |
1016 | |
1017 A `sample code in the source distribution | |
449 | 1018 <https://hg.orthanc-server.com/orthanc/file/default/OrthancServer/Resources/Samples/Python/ChangesLoop.py>`__ |
0 | 1019 shows how to use this Changes API to implement a polling loop. |
1020 | |
1021 | |
1022 Deleting resources from Orthanc | |
1023 ------------------------------- | |
1024 | |
1025 .. highlight:: bash | |
1026 | |
1027 Deleting patients, studies, series or instances | |
1028 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
1029 | |
1030 Deleting DICOM resources (i.e. patients, studies, series or instances) | |
1031 from Orthanc is as simple as using a HTTP DELETE on the URI of this | |
1032 resource. | |
1033 | |
1034 Concretely, you would first explore the resources that are stored in | |
1035 Orthanc :ref:`as explained above <rest-access>`:: | |
1036 | |
1037 $ curl http://localhost:8042/patients | |
1038 $ curl http://localhost:8042/studies | |
1039 $ curl http://localhost:8042/series | |
1040 $ curl http://localhost:8042/instances | |
1041 | |
1042 Secondly, once you have spotted the resources to be removed, you would | |
1043 use the following command-line syntax to delete them:: | |
1044 | |
1045 $ curl -X DELETE http://localhost:8042/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94 | |
1046 $ curl -X DELETE http://localhost:8042/studies/c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f | |
1047 $ curl -X DELETE http://localhost:8042/series/cceb768f-e0f8df71-511b0277-07e55743-9ef8890d | |
1048 $ curl -X DELETE http://localhost:8042/instances/8e289db9-0e1437e1-3ecf395f-d8aae463-f4bb49fe | |
1049 | |
1050 | |
1051 Clearing log of changes | |
1052 ^^^^^^^^^^^^^^^^^^^^^^^ | |
1053 | |
1054 :ref:`As described above <changes>`, Orthanc keeps track of all the | |
1055 changes that occur in the DICOM store. This so-called "Changes Log" | |
1056 is accessible at the following URI:: | |
1057 | |
1058 $ curl http://localhost:8042/changes | |
1059 | |
1060 To clear the content of the Changes Log, simply DELETE this URI:: | |
1061 | |
1062 $ curl -X DELETE http://localhost:8042/changes | |
1063 | |
1064 | |
155 | 1065 Log of exported resources |
1066 ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
1067 | |
1068 For medical traceability, Orthanc can be configured to store a log of | |
1069 all the resources that have been exported to remote modalities:: | |
0 | 1070 |
1071 $ curl http://localhost:8042/exports | |
1072 | |
1073 In auto-routing scenarios, it is important to prevent this log to grow | |
1074 indefinitely as incoming instances are routed. You can either disable | |
1075 this logging by setting the option ``LogExportedResources`` to ``false`` | |
1076 in the :ref:`configuration file <configuration>`, or periodically | |
1077 clear this log by DELETE-ing this URI:: | |
1078 | |
1079 $ curl -X DELETE http://localhost:8042/exports | |
1080 | |
155 | 1081 NB: Starting with Orthanc 1.4.0, the ``LogExportedResources`` is set |
1082 to ``false`` by default. If the logging is desired, set this option to | |
1083 ``true``. | |
1084 | |
0 | 1085 |
1086 Anonymization and modification | |
1087 ------------------------------ | |
1088 | |
1089 The process of anonymizing and modifying DICOM resources is | |
1090 :ref:`documented in a separate page <anonymization>`. | |
1091 | |
1092 | |
1093 Further reading | |
1094 --------------- | |
1095 | |
1096 The examples above have shown you the basic principles for driving an | |
1097 instance of Orthanc through its REST API. All the possibilities of the | |
35
5737f51ff94e
How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
1098 API have not been described: |
5737f51ff94e
How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
1099 |
224
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
223
diff
changeset
|
1100 * Advanced features of the REST API can be found on :ref:`another page |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
223
diff
changeset
|
1101 <rest-advanced>`. |
35
5737f51ff94e
How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
1102 * A :ref:`FAQ entry <rest-samples>` lists where you can find more |
5737f51ff94e
How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
1103 advanced samples of the REST API of Orthanc. |
577
7d27154e70f9
cheatsheet and full openapi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
557
diff
changeset
|
1104 * A :ref:`short reference of the REST API of Orthanc <cheatsheet>` is |
7d27154e70f9
cheatsheet and full openapi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
557
diff
changeset
|
1105 part of the Orthanc Book. |
7d27154e70f9
cheatsheet and full openapi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
557
diff
changeset
|
1106 * The full documentation of the REST API in the OpenAPI/Swagger format |
7d27154e70f9
cheatsheet and full openapi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
557
diff
changeset
|
1107 is `available online <https://api.orthanc-server.com/>`__. This |
7d27154e70f9
cheatsheet and full openapi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
557
diff
changeset
|
1108 reference is automatically generated from the source code of |
7d27154e70f9
cheatsheet and full openapi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
557
diff
changeset
|
1109 Orthanc. |