annotate Sphinx/source/users/rest.rst @ 247:325dd3901547

ohif
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 19 May 2019 10:08:52 +0200
parents 02399e86f046
children 2946fcd2e7fa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _rest:
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 REST API of Orthanc
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ===================
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 .. contents::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 :depth: 3
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 One of the major strengths of Orthanc lies in its built-in `RESTful
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 API
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 <https://en.wikipedia.org/wiki/Representational_state_transfer>`__,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 that can be used to drive Orthanc from external applications,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 independently of the programming language that is used to develop
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 these applications. The REST API of Orthanc gives a full programmatic
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 access to all the core features of Orthanc.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 Importantly, Orthanc Explorer (the embedded administrative interface
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 of Orthanc) entirely resorts to this REST API for all its features.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 This implies that anything that can be done through Orthanc Explorer,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 can also be done through REST queries.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *Note:* All the examples are illustrated with the `cURL command-line
25
669ea65ba7fb fix links
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
23 tool <https://curl.haxx.se/>`__, but equivalent calls can be readily
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 transposed to any programming language that supports both HTTP and
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 JSON.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
114
736d30badda0 large POST body
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
28 .. _sending-dicom-images:
736d30badda0 large POST body
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
29
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 Sending DICOM images
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 --------------------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 The upload of DICOM files is possible by querying the REST API using
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 the following syntax::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 $ curl -X POST http://localhost:8042/instances --data-binary @CT.X.1.2.276.0.7230010.dcm
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 Orthanc will respond with a JSON file that contain information about
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 the location of the stored instance, such as::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 "ID" : "e87da270-c52b-4f2a-b8c6-bae25928d0b0",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 "Path" : "/instances/e87da270-c52b-4f2a-b8c6-bae25928d0b0",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 "Status" : "Success"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 Note that in the case of curl, setting the ``Expect`` HTTP Header will
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 significantly `reduce the execution time of POST requests
25
669ea65ba7fb fix links
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
55 <http://stackoverflow.com/questions/463144/php-http-post-fails-when-curl-data-1024/463277#463277>`__::
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 $ curl -X POST -H "Expect:" http://localhost:8042/instances --data-binary @CT.X.1.2.276.0.7230010.dcm
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 The code distribution of Orthanc contains a `sample Python script
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/ImportDicomFiles/ImportDicomFiles.py>`__
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 that recursively upload the content of some folder into Orthanc using
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 the REST API::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 $ python ImportDicomFiles.py localhost 8042 ~/DICOM/
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 .. _rest-access:
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 Accessing the content of Orthanc
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 --------------------------------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 Orthanc structures the stored DICOM resources using the "Patient,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 Study, Series, Instance" model of the DICOM standard. Each DICOM
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 resource is associated with an :ref:`unique identifier <orthanc-ids>`.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 List all the DICOM resources
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 Here is how you would list all the DICOM resources that are stored in
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 your local Orthanc instance::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 $ curl http://localhost:8042/patients
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 $ curl http://localhost:8042/studies
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 $ curl http://localhost:8042/series
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 $ curl http://localhost:8042/instances
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 Note that the result of this command is a `JSON file
25
669ea65ba7fb fix links
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
88 <https://en.wikipedia.org/wiki/Json>`__ that contains an array of
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 resource identifiers. The JSON file format is lightweight and can be
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 parsed from almost any computer language.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 Accessing a patient
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 ^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 To access a single resource, add its identifier to the `URI
25
669ea65ba7fb fix links
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
98 <https://en.wikipedia.org/wiki/Uniform_resource_identifier>`__. You
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 would for instance retrieve the main information about one patient as
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 follows::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 $ curl http://localhost:8042/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 Here is a possible answer from Orthanc::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 "ID" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 "MainDicomTags" : {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 "OtherPatientIDs" : "(null)",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 "PatientBirthDate" : "0",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 "PatientID" : "000000185",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 "PatientName" : "Anonymous^Unknown",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 "PatientSex" : "O"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 "Studies" : [ "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15" ],
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 "Type" : "Patient"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 This is once again a JSON file. Note how Orthanc gives you a summary
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 of the main DICOM tags that correspond to the patient level.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
168
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
124
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
125 .. _browsing-hierarchy:
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
126
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 Browsing from the patient down to the instance
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 The field ``Studies`` list all the DICOM studies that are associated
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 with the patient. So, considering the patient above, we would go down
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 in her DICOM hierarchy as follows::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 $ curl http://localhost:8042/studies/9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 And Orthanc could answer::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 "ID" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 "MainDicomTags" : {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 "AccessionNumber" : "(null)",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 "StudyDate" : "20120716",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 "StudyDescription" : "TestSUVce-TF",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 "StudyID" : "23848",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 "StudyInstanceUID" : "1.2.840.113704.1.111.7016.1342451220.40",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 "StudyTime" : "170728"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 "ParentPatient" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 "Series" : [
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 "6821d761-31fb55a9-031ebecb-ba7f9aae-ffe4ddc0",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 "7384c47e-6398f2a8-901846ef-da1e2e0b-6c50d598"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 ],
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 "Type" : "Study"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 The main DICOM tags are now those that are related to the study
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 level. It is possible to retrieve the identifier of the patient in the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 ``ParentPatient`` field, which can be used to go upward the DICOM
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 hierarchy. But let us rather go down to the series level by using the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 ``Series`` array. The next command would return information about one
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 of the three series that have just been reported::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 $ curl http://localhost:8042/series/2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 Here is a possible answer::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 "ExpectedNumberOfInstances" : 45,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 "ID" : "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 "Instances" : [
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 "41bc3f74-360f9d10-6ae9ffa4-01ea2045-cbd457dd",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 "1d3de868-6c4f0494-709fd140-7ccc4c94-a6daa3a8",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 <...>
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 "1010f80b-161b71c0-897ec01b-c85cd206-e669a3ea",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 "e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 ],
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 "MainDicomTags" : {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 "Manufacturer" : "Philips Medical Systems",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 "Modality" : "PT",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 "NumberOfSlices" : "45",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 "ProtocolName" : "CHU/Body_PET/CT___50",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 "SeriesDate" : "20120716",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 "SeriesDescription" : "[WB_CTAC] Body",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 "SeriesInstanceUID" : "1.3.46.670589.28.2.12.30.26407.37145.2.2516.0.1342458737",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 "SeriesNumber" : "587370",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 "SeriesTime" : "171121",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 "StationName" : "r054-svr"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 "ParentStudy" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 "Status" : "Complete",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 "Type" : "Series"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 It can be seen that this series comes from a PET modality. Orthanc has
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 computed that this series should contain 45 instances.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 So far, we have navigated from the patient level, to the study level,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 and finally to the series level. There only remains the instance
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 level. Let us dump the content of one of the instances::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 The instance contains the following information::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 "FileSize" : 70356,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 "FileUuid" : "3fd265f0-c2b6-41a2-ace8-ae332db63e06",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 "ID" : "e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 "IndexInSeries" : 6,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 "MainDicomTags" : {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 "ImageIndex" : "6",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 "InstanceCreationDate" : "20120716",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 "InstanceCreationTime" : "171344",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 "InstanceNumber" : "6",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 "SOPInstanceUID" : "1.3.46.670589.28.2.15.30.26407.37145.3.2116.39.1342458737"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 "ParentSeries" : "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 "Type" : "Instance"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 The instance has the index 6 in the parent series. The instance is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 stored as a raw DICOM file of 70356 bytes. You would download this
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 DICOM file using the following command::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/file > Instance.dcm
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 Accessing the DICOM fields of an instance as a JSON file
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 When one gets to the instance level, you can retrieve the hierarchy of
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 all the DICOM tags of this instance as a JSON file::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/simplified-tags
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 Here is a excerpt of the Orthanc answer::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 "ACR_NEMA_2C_VariablePixelDataGroupLength" : "57130",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 "AccessionNumber" : null,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 "AcquisitionDate" : "20120716",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 "AcquisitionDateTime" : "20120716171219",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 "AcquisitionTime" : "171219",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 "ActualFrameDuration" : "3597793",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 "AttenuationCorrectionMethod" : "CTAC-SG",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 <...>
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 "PatientID" : "000000185",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 "PatientName" : "Anonymous^Unknown",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 "PatientOrientationCodeSequence" : [
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 "CodeMeaning" : "recumbent",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 "CodeValue" : "F-10450",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 "CodingSchemeDesignator" : "99SDM",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 "PatientOrientationModifierCodeSequence" : [
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 "CodeMeaning" : "supine",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 "CodeValue" : "F-10340",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 "CodingSchemeDesignator" : "99SDM"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 ]
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 ],
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 <...>
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 "StudyDescription" : "TestSUVce-TF",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 "StudyID" : "23848",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 "StudyInstanceUID" : "1.2.840.113704.1.111.7016.1342451220.40",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 "StudyTime" : "171117",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 "TypeOfDetectorMotion" : "NONE",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 "Units" : "BQML",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 "Unknown" : null,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 "WindowCenter" : "1.496995e+04",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 "WindowWidth" : "2.993990e+04"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 If you need more detailed information about the type of the variables
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 or if you wish to use the hexadecimal indexes of DICOM tags, you are
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 free to use the following URL::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/tags
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 Accessing the raw DICOM fields of an instance
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 You also have the opportunity to access the raw value of the DICOM
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 tags of an instance, without going through a JSON file. Here is how
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 you would find the Patient Name of the instance::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 $ 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
312 Anonymous^Unknown
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 The list of all the available tags for this instance can also be retrieved easily::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 It is also possible to recursively explore the sequences of tags::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content/0008-1250/0/0040-a170/0/0008-0104
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 For Attenuation Correction
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 The command above has opened the "0008-1250" tag that is a DICOM
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 sequence, taken its first child, opened its "0040-a170" tag that is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 also a sequence, taken the first child of this child, and returned the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 "0008-0104" DICOM tag.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 Downloading images
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 ^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332
168
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
333 As :ref:`explained above <browsing-hierarchy>`, the raw DICOM file
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
334 corresponding to a single instance can be retrieved as follows::
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
335
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
336 $ 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
337
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
338 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
339 to some DICOM instance::
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340
168
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
341 $ 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
342
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
343 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
344 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
345 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
346 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
347 <https://en.wikipedia.org/wiki/List_of_HTTP_header_fields>`__
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
348 ``Accept`` to ``image/jpeg``::
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
349
169
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 168
diff changeset
350 $ curl -H 'Accept: image/jpeg' http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/preview > Preview.jpg
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351
168
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
352 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
353 16bpp PNG image, you can use the following URIs::
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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/image-uint8 > full-8.png
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
356 $ 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
357
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
358 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
359 be encoded by the target image format. The
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
360 ``/instances/{...}/image-int16`` is available as well to download
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
361 signed DICOM pixel data.
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
168
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
363 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
364 the generic `PAM format
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
365 <https://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format>`__::
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
366
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
367 $ curl -H 'Accept: image/x-portable-arbitrarymap' http://localhost:8042/instances/609665c0-c5198aa2-8632476b-a00e0de0-e9075d94/image-uint16 > full-16.pam
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368
168
86e92d0cc53e information about images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
369 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
370 dedicated section <matlab>`.
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371
218
amazy
parents: 216
diff changeset
372
amazy
parents: 216
diff changeset
373 .. _peering:
amazy
parents: 216
diff changeset
374
216
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
375 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
376 -----------------------------------------------------------------------------
216
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
377
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
378 Orthanc can send its DICOM instances to remote Orthanc over HTTP/HTTPS through its Rest API.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
379 This process can be triggered by the REST API.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
380
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
381 Configuration
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
382 ^^^^^^^^^^^^^
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
383
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
384 .. highlight:: json
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
385
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
386 You first have to declare the Url of the remote orthanc inside the :ref:`configuration file
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
387 <configuration>`. For instance, here is how to declare a remote
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
388 orthanc peer::
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
389
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
390 ...
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
391 "Peers" : {
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
392 "sample" : [ "http://localhost:8043" ], // short version
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
393 "sample2" : { // long version
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
394 "Url" : "http://localhost:8044",
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
395 "Username" : "alice", // optional
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
396 "Password" : "alicePassword", // optional
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
397 "HttpHeaders" : { "Token" : "Hello world" }, // optional
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
398 "CertificateFile" : "client.crt", // optional (only if using client certificate authentication)
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
399 "CertificateKeyFile" : "client.key", // optional (only if using client certificate authentication)
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
400 "CertificateKeyPassword" : "certpass" // optional (only if using client certificate authentication)
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
401 },
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
402 ...
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
403
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
404 .. highlight:: bash
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
405
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
406 Such a configuration would enable Orthanc to connect to two other
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
407 Orthanc instances that listens on the
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
408 localhost on the port 8043 & 8044. The peers that are known to Orthanc
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
409 can be queried::
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
410
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
411 $ curl http://localhost:8042/peers?expand
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
412
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
413 The peers can then be updated through the API too::
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
414
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
415 $ curl -v -X PUT http://localhost:8042/peers/sample -d '{"Url" : "http://127.0.0.1:8043"}'
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
416
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
417
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
418 Note that, by default, peers are stored in Orthanc configuration files
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
419 and are updated in Orthanc memory only. If you want your modifications
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
420 to be persistent, you should configure Orthanc to store its peers
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
421 in the database. This is done through this configuration::
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422
216
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
423 ...
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
424 "OrthancPeersInDatabase" : true,
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
425 ...
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
426
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
427 Sending One Resource
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
428 ^^^^^^^^^^^^^^^^^^^^
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
429
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
430 .. highlight:: bash
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
431
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
432 Once you have identified the Orthanc identifier of the DICOM resource
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
433 that would like to send :ref:`as explained above <rest-access>`, you
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
434 would use the following command to send it::
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
435
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
436 $ curl -X POST http://localhost:8042/peers/sample/store -d c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
437
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
438 The ``/sample/`` component of the URI corresponds to the identifier of
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
439 the remote modality, as specified above in the configuration file.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
440
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
441 Note that you can send isolated DICOM instances with this command, but
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
442 also entire patients, studies or series. It is possible to send multiple instances with a single POST
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
443 request::
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
444
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
445 $ 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"]'
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
446
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
447 Note that the list of resources to be sent can include the
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
448 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients,
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
449 studies or series as well.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
450
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
451 Using HTTPS
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
452 ^^^^^^^^^^^
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
453
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
454 If you're transfering medical data over internet, it is mandatory to use HTTPS.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
455
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
456 On the server side, we recommend to put Orthanc behing an :ref:`HTTPS server that will take care of the TLS <https>`.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
457
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
458 On the client side, in order for the client Orthanc to recognize the server certificate, you'll have to provide a path
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
459 to the CA (certification authority) certificates. This is done in the configuration file through this configurationg::
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
460
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
461 ...
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
462 "HttpsCACertificates" : "/etc/ssl/certs/ca-certificates.crt,
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
463 ...
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
464
223
9ccafca945d2 Fixed small typo
Benjamin Golinvaux <bgo@osimis.io>
parents: 218
diff changeset
465 If you want your server to accept incoming connections for known hosts only, you can either:
216
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
466
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
467 - configure a firewall to accept incoming connections from known IP addresses
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
468 - 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.
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
469
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
470
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
471
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
472
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
473 Sending resources to remote modalities (through DICOM)
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
474 ------------------------------------------------------
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 Orthanc can send its DICOM instances to remote DICOM modalities (C-Store SCU). This process
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 can be triggered by the REST API.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 Configuration
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 ^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 You first have to declare the AET, the IP address and the port number
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 of the remote modality inside the :ref:`configuration file
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 <configuration>`. For instance, here is how to declare a remote
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 modality::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 ...
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 "DicomModalities" : {
212
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
491 "sample" : [ "ORTHANCA", "127.0.0.1", 2000 ], // short version
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
492 "sample2" : { // long version
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
493 "AET" : "ORTHANCB",
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
494 "Port" : 2001,
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
495 "Host" : "127.0.0.1",
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
496 "Manufacturer" : "Generic",
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
497 "AllowEcho" : true,
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
498 "AllowFind" : true,
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
499 "AllowMove" : true,
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
500 "AllowStore" : true
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
501 }
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 ...
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506
212
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
507 Such a configuration would enable Orthanc to connect to two DICOM
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
508 stores (for instance, other Orthanc instances) that listens on the
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
509 localhost on the port 2000 & 2001. The modalities that are known to Orthanc
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 can be queried::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511
212
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
512 $ curl http://localhost:8042/modalities?expand
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
513
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
514 The modalities can then be updated through the API too::
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
515
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
516 $ curl -v -X PUT http://localhost:8042/modalities/sample -d '{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}'
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
517
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518
212
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
519 Note that, by default, modalities are stored in Orthanc configuration files
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
520 and are updated in Orthanc memory only. If you want your modifications
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
521 to be persistent, you should configure Orthanc to store its modalities
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
522 in the database. This is done through this configuration::
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
523
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
524 ...
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
525 "DicomModalitiesInDatabase" : true,
7ff807cc5ade added modalities configuration
amazy
parents: 207
diff changeset
526 ...
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 Sending One Resource
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 ^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 Once you have identified the Orthanc identifier of the DICOM resource
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 that would like to send :ref:`as explained above <rest-access>`, you
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 would use the following command to send it::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 $ curl -X POST http://localhost:8042/modalities/sample/store -d c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 The ``/sample/`` component of the URI corresponds to the identifier of
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 the remote modality, as specified above in the configuration file.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541
173
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
542 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
543 also entire patients, studies or series.
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 Bulk Store SCU
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 ^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 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
551 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
552 communication overhead if sending multiple isolated instances by
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
553 making one REST call for each of these instances.
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 To circumvent this problem, you have 2 possibilities:
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 1. Set the ``DicomAssociationCloseDelay`` option in the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 :ref:`configuration file <configuration>` to a non-zero value. This
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 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
560 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
561 autorouting images :ref:`using Lua <lua-auto-routing>`.
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562
173
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
563 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
564 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
565 0.5.2)::
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 $ 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"]'
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 The list of the resources to be sent are given as a JSON array. In
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 this case, a single DICOM connection is used. `Sample code is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 available
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/HighPerformanceAutoRouting.py>`__.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573
173
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
574 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
575 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients,
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
576 studies or series as well.
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
577
901bc7b2dbab improved bulk store scu section
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 169
diff changeset
578
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
580 Performing Query/Retrieve and Find with REST
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
581 --------------------------------------------
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
582
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
583 *Section contributed by Bryan Dearlove*
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
584
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
585 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
586 or on remote modalities through the REST API.
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
587
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
588 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
589 within the :ref:`configuration file <configuration>` (See
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
590 Configuration section under Sending resources to remote modalities).
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
591
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
592
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
593 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
594 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
595
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
596 .. highlight:: bash
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
597
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
598 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
599 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
600 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
601 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
602 insensitive unless configured otherwise within the Orthanc
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
603 configuration file::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
604
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
605 $ curl --request POST \
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
606 --url http://localhost:8042/modalities/sample/query \
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
607 --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}'
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
608
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
609
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
610 .. highlight:: json
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
611
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
612 You will receive back an ID which can be used to retrieve more
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
613 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
614
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
615 {
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
616 "ID": "5af318ac-78fb-47ff-b0b0-0df18b0588e0",
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
617 "Path": "/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0"
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
618 }
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
619
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
620
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
621 Additional Options
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
622 ^^^^^^^^^^^^^^^^^^
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
623
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
624 .. highlight:: json
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
625
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
626 You can use patient identifiers by including the `*` within your
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
627 search. For example if you were searching for a name beginning with
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
628 `Jones` you can do::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
629
139
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 138
diff changeset
630 "PatientName":"Jones*"
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
631
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
632 If you wanted to search for a name with the words `Jo` anywhere within
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
633 it you can do::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
634
139
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 138
diff changeset
635 "PatientName":"*Jo*"
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
636
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
637 To perform date searches you can specify within StudyDate a starting
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
638 date and/or a before date. For example ``"StudyDate":"20180323-"``
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
639 would search for all study dates after the specified date to
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
640 now. Doing ``"StudyDate":"20180323-20180325"`` would search for all
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
641 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
642
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
643
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
644 Reviewing Level
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
645 ^^^^^^^^^^^^^^^
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
646
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
647 .. highlight:: bash
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
648
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
649 ::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
650
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
651 $ 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
652
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
653 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
654 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
655
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
656
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
657 Reviewing Modality
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
658 ^^^^^^^^^^^^^^^^^^
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
659
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
660 .. highlight:: bash
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
661
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
662 ::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
663
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
664 $ 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
665
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
666 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
667
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
668
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
669 Reviewing Query
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
670 ^^^^^^^^^^^^^^^
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
671
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
672 .. highlight:: bash
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
673
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
674 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
675 performed using you can use the query filter::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
676
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
677 $ 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
678
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
679
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
680 Reviewing Query Answers
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
681 ^^^^^^^^^^^^^^^^^^^^^^^
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
682
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
683 .. highlight:: bash
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
684
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
685 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
686 a GET with the answers parameter::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
687
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
688 $ 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
689
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
690 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
691 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
692 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
693 for content details::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
694
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
695 $ 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
696
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
697 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
698 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
699 listed in this JSON answer in the initial query we would add to the
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
700 POST body: `"ModalitiesInStudy":""`
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
701
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
702
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
703 Performing Retrieve (C-Move)
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
704 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
705
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
706 .. highlight:: bash
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
707
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
708 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
709 query using a post command and identifying the Modality (named in this
207
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
710 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
711
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
712 $ 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
713
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
714 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
715 specifying that individual content item::
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
716
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
717 $ 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
718
207
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
719 If C-Moves take too long (for example, performing a C-Move of a big
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
720 study), you may run the request in asynchronous fashion, which will
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
721 create a job in Orthanc::
205
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
722
207
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
723 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/retrieve \
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
724 --data '{"TargetAet":"Orthanc","Synchronous":false}'
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
725
205
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
726
207
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
727 .. highlight:: bash
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
728
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
729 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
730
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
731 {
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
732 "ID" : "11541b16-e368-41cf-a8e9-3acf4061d238",
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
733 "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
734 }
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
735
7213bef30604 rest.rst edited online with Bitbucket.
Diego Fernández Slezak <dfslezak@gmail.com>
parents: 173
diff changeset
736
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
737 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
738 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
739 .. highlight:: bash
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
740
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
741 Performing a find within Orthanc is very similar to using Queries
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
742 against DICOM modalities and the additional options listed above work
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
743 with find also. When performing a find, you will receive the Orthanc
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
744 ID's of all the matched items within your find. For example if you
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
745 perform a study level find and 5 Studies match you will receive 5
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
746 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
747
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
748 $ curl --request POST --url http://localhost:8042/tools/find --data '{"Level":"Instance","Query":{"Modality":"CR","StudyDate":"20180323-","PatientID":"*"}}'
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
749
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
750
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
751 Additional Options
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
752 ^^^^^^^^^^^^^^^^^^
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
753 .. highlight:: json
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
754
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
755 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
756
138
f3127d33cf5e rst syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 136
diff changeset
757 "Limit":4
136
8e08909ab69b Added find information to: Performing Query/Retrieve and Find with REST
Bryan Dearlove <bdearlove@gmail.com>
parents: 132
diff changeset
758
132
55a2ee3c462d Performing Query/Retrieve with REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
759
216
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
760 .. _changes:
dcf6c2e60448 added section about peering (wip)
amazy
parents: 212
diff changeset
761
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 Tracking changes
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 ----------------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 Whenever Orthanc receives a new DICOM instance, this event is recorded
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 in the so-called "Changes Log". This enables remote scripts to react
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 to the arrival of new DICOM resources. A typical application is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 **auto-routing**, where an external script waits for a new DICOM
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771 instance to arrive into Orthanc, then forward this instance to another
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 modality.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 The Changes Log can be accessed by the following command::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 $ curl http://localhost:8042/changes
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 .. highlight:: json
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 Here is a typical output::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 "Changes" : [
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 "ChangeType" : "NewInstance",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 "Date" : "20130507T143902",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 "ID" : "8e289db9-0e1437e1-3ecf395f-d8aae463-f4bb49fe",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 "Path" : "/instances/8e289db9-0e1437e1-3ecf395f-d8aae463-f4bb49fe",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 "ResourceType" : "Instance",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 "Seq" : 921
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 "ChangeType" : "NewSeries",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 "Date" : "20130507T143902",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 "ID" : "cceb768f-e0f8df71-511b0277-07e55743-9ef8890d",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 "Path" : "/series/cceb768f-e0f8df71-511b0277-07e55743-9ef8890d",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 "ResourceType" : "Series",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 "Seq" : 922
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 "ChangeType" : "NewStudy",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 "Date" : "20130507T143902",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 "ID" : "c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 "Path" : "/studies/c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 "ResourceType" : "Study",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 "Seq" : 923
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 },
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 {
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 "ChangeType" : "NewPatient",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 "Date" : "20130507T143902",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 "ID" : "dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 "Path" : "/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813 "ResourceType" : "Patient",
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 "Seq" : 924
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 ],
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 "Done" : true,
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 "Last" : 924
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 }
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 This output corresponds to the receiving of one single DICOM instance
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 by Orthanc. It records that a new instance, a new series, a new study
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 and a new patient has been created inside Orthanc. Note that each
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 changes is labeled by a ``ChangeType``, a ``Date`` (in the `ISO format
25
669ea65ba7fb fix links
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
825 <https://en.wikipedia.org/wiki/ISO_8601>`__), the location of the
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 resource inside Orthanc, and a sequence number (``Seq``).
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828 Note that this call is non-blocking. It is up to the calling program
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829 to wait for the occurrence of a new event (by implementing a polling
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 loop).
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 This call only returns a fixed number of events, that can be changed
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 by using the ``limit`` option::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 $ curl http://localhost:8042/changes?limit=100
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 The flag ``Last`` records the sequence number of the lastly returned
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 event. The flag ``Done`` is set to ``true`` if no further event has
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 occurred after this lastly returned event. If ``Done`` is set to
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 ``false``, further events are available and can be retrieved. This is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 done by setting the ``since`` option that specifies from which
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844 sequence number the changes must be returned::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 $ curl 'http://localhost:8042/changes?limit=100&since=922'
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848 A `sample code in the source distribution
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/ChangesLoop.py>`__
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 shows how to use this Changes API to implement a polling loop.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 Deleting resources from Orthanc
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 -------------------------------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 .. highlight:: bash
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 Deleting patients, studies, series or instances
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 Deleting DICOM resources (i.e. patients, studies, series or instances)
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 from Orthanc is as simple as using a HTTP DELETE on the URI of this
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863 resource.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865 Concretely, you would first explore the resources that are stored in
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 Orthanc :ref:`as explained above <rest-access>`::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 $ curl http://localhost:8042/patients
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 $ curl http://localhost:8042/studies
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 $ curl http://localhost:8042/series
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 $ curl http://localhost:8042/instances
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 Secondly, once you have spotted the resources to be removed, you would
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 use the following command-line syntax to delete them::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876 $ curl -X DELETE http://localhost:8042/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 $ curl -X DELETE http://localhost:8042/studies/c4ec7f68-9b162055-2c8c5888-5bf5752f-155ab19f
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 $ curl -X DELETE http://localhost:8042/series/cceb768f-e0f8df71-511b0277-07e55743-9ef8890d
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879 $ curl -X DELETE http://localhost:8042/instances/8e289db9-0e1437e1-3ecf395f-d8aae463-f4bb49fe
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 Clearing log of changes
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 ^^^^^^^^^^^^^^^^^^^^^^^
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 :ref:`As described above <changes>`, Orthanc keeps track of all the
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 changes that occur in the DICOM store. This so-called "Changes Log"
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 is accessible at the following URI::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 $ curl http://localhost:8042/changes
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 To clear the content of the Changes Log, simply DELETE this URI::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 $ curl -X DELETE http://localhost:8042/changes
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895
155
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
896 Log of exported resources
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
897 ^^^^^^^^^^^^^^^^^^^^^^^^^
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
898
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
899 For medical traceability, Orthanc can be configured to store a log of
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
900 all the resources that have been exported to remote modalities::
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 $ curl http://localhost:8042/exports
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 In auto-routing scenarios, it is important to prevent this log to grow
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 indefinitely as incoming instances are routed. You can either disable
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 this logging by setting the option ``LogExportedResources`` to ``false``
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907 in the :ref:`configuration file <configuration>`, or periodically
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908 clear this log by DELETE-ing this URI::
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 $ curl -X DELETE http://localhost:8042/exports
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911
155
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
912 NB: Starting with Orthanc 1.4.0, the ``LogExportedResources`` is set
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
913 to ``false`` by default. If the logging is desired, set this option to
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
914 ``true``.
498c9e42c99d exported resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
915
0
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 Anonymization and modification
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 ------------------------------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 The process of anonymizing and modifying DICOM resources is
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 :ref:`documented in a separate page <anonymization>`.
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924 Further reading
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 ---------------
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 The examples above have shown you the basic principles for driving an
901e8961f46e initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 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
929 API have not been described:
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
930
224
02399e86f046 starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 223
diff changeset
931 * 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
932 <rest-advanced>`.
35
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
933 * 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
934 advanced samples of the REST API of Orthanc.
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
935 * The full documentation of the REST API is maintained as an online
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
936 spreadsheet accessible from the `documentation part of the official
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
937 Web site
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
938 <http://www.orthanc-server.com/static.php?page=documentation>`__
5737f51ff94e How does Orthanc stores its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 25
diff changeset
939 (click on the *Reference of the REST API* button).