Mercurial > hg > orthanc-book
annotate Sphinx/source/faq/features.rst @ 621:05a5a7369126
documenting attachments 1, 2 and 3
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 26 Feb 2021 09:00:27 +0100 |
parents | 6e7d3f20227b |
children | debcf6b6d070 |
rev | line source |
---|---|
0 | 1 Terminology of advanced features |
2 ================================ | |
3 | |
224
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
4 .. contents:: |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
5 :depth: 3 |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
6 |
0 | 7 .. _peers: |
8 | |
9 Peers | |
10 ----- | |
11 | |
12 An "Orthanc peer" is another instance of Orthanc, possibly running on | |
13 a remote computer. | |
14 | |
15 Contrarily to a "modality", it is possible to communicate with a peer | |
16 through the **HTTP/HTTPS protocol** (i.e. through the REST API of | |
17 Orthanc), and not through the DICOM protocol. This implies a much | |
18 easier configuration: It is only required to know the URL, the | |
19 username and the password to communicate with an Orthanc peer. This | |
20 contrasts with DICOM query/retrieve, that is quite complex and that | |
21 involves a lot of pitfalls (cf. the FAQ entry about :ref:`troubleshooting | |
22 DICOM communications <dicom>`) that can be bypassed if using HTTP. | |
23 | |
24 Furthermore, as HTTP(S) communications are generally not blocked by | |
25 firewalls (contrarily to the DICOM protocol that is inherently an | |
26 Intranet protocol and that often requires the setup of VPN tunnels), | |
27 it is much easier to setup communications of medical images through | |
218 | 28 the Internet with :ref:`Orthanc peers <peering>`. |
0 | 29 |
30 | |
31 .. _recycling: | |
32 | |
33 Recycling/Protection | |
34 -------------------- | |
35 | |
36 Because of its focus on low-end computers, Orthanc implements **disk | |
37 space recycling**: The patient that has been stored for the longest | |
38 time inside Orthanc can be automatically deleted when the disk space | |
39 used by Orthanc grows above a threshold, or when the number of stored | |
40 patients grows above a threshold. This feature enables the automated | |
278 | 41 control of the disk space dedicated to Orthanc. Note that each time |
42 a new instance is received for an existing patient, the patient will | |
43 be marked as the most recent one in the recycling order. | |
0 | 44 |
45 Recycling is controlled by the ``MaximumStorageSize`` and the | |
46 ``MaximumPatientCount`` options in the :ref:`Orthanc configuration | |
106 | 47 file <configuration>`. Setting both these values to 0 will disable |
48 recycling. | |
0 | 49 |
50 It is possible to prevent important data from being automatically | |
51 recycled. This mechanism is called **protection**. Each patient can be | |
52 individually protected against recycling by using the | |
53 ``Unprotected/Protected`` switch that is available from Orthanc | |
54 Explorer. | |
55 | |
56 Note that protection is only available at the patient level. It | |
57 protects all the studies/series/instances of the patient against | |
58 recycling. The rationale is that we think it is important to keep | |
59 available all the data related to one patient. Unwillingly losing a | |
60 study/series that is part of the same patient might lead to a loss in | |
61 consistency with respect to the medical history of this patient. | |
62 | |
63 .. _compression: | |
64 | |
65 Compression | |
66 ----------- | |
67 | |
68 If your disk space is limited, besides :ref:`recycling`, you should | |
69 also consider using **disk space compression**. When compression is | |
70 enabled, Orthanc compresses the incoming DICOM instances on-the-fly | |
71 before writing them to the filesystem, using `zlib | |
25 | 72 <https://en.wikipedia.org/wiki/Zlib>`_. This is useful, because the |
0 | 73 images are often stored as raw, uncompressed arrays in DICOM |
74 instances: The size of a typical DICOM instance can hopefully be | |
75 divided by a factor 2 through lossless compression. This compression | |
76 process is transparent to the user, as Orthanc automatically | |
77 decompresses the file before sending it back to the external world. | |
78 | |
79 Compression is controlled by the ``StorageCompression`` option in the | |
80 :ref:`Orthanc configuration file <configuration>`. | |
78 | 81 |
82 | |
83 .. _metadata: | |
84 | |
92 | 85 Metadata & attachments |
86 ---------------------- | |
78 | 87 |
88 Metadata consists in an **associative key-value array** (mapping a | |
89 integer key in the range [0,65535] to a string value) that is | |
90 associated with each :ref:`DICOM resource <orthanc-ids>` stored inside | |
91 Orthanc (may it be a patient, a study, a series or a DICOM | |
92 instance). Metadata can be either referred to using the integer key, | |
93 or using a symbolic name (if configured). Metadata records | |
94 information that is not readily available in the DICOM tags. | |
95 | |
96 In spirit, the metadata mechanism is similar to the :ref:`attachment | |
97 mechanism <orthanc-storage>`. However, metadata is stored directly | |
98 inside the database, whereas attachments are stored as separate files | |
99 on the filesystem (the database only stores a reference to the | |
100 attachments). Choosing between metadata and attachments is a matter of | |
101 trade-off: Metadata must be kept small (as a rule of thumb, under 1KB) | |
102 and used if fast access is needed, whereas attachments can be used to | |
103 store arbitrarily large piece of data. | |
104 | |
79 | 105 Also note that metadata and attachments are only available for |
106 resources stored inside Orthanc. Once one DICOM instance leaves the | |
107 Orthanc ecosystem, its associated metadata and attachments are lost. | |
108 | |
78 | 109 |
110 Core metadata | |
111 ^^^^^^^^^^^^^ | |
112 | |
113 Here are the main metadata handled by the Orthanc core: | |
114 | |
115 * ``ReceptionDate`` records when a DICOM instance was received by | |
116 Orthanc. Similarly, ``LastUpdate`` records, for each | |
117 patient/study/series, the last time a DICOM instance was added to | |
118 this resource. | |
119 * ``RemoteAet`` records the AET of the modality that has sent some | |
120 DICOM instance to Orthanc. | |
121 * ``ModifiedFrom`` and ``AnonymizedFrom`` hold from which original | |
122 resource, a resource was modified or anonymized. The presence of | |
123 this metadata indicates that the resource is the result of a | |
124 modification or anonymization that was carried on by Orthanc. | |
125 * ``Origin`` records through which mechanism the instance was received | |
126 by Orthanc (may be ``Unknown``, ``DicomProtocol``, ``RestApi``, | |
127 ``Plugins``, or ``Lua``). | |
128 * ``IndexInSeries`` records the expected index of a DICOM instance | |
129 inside its parent series. Conversely, ``ExpectedNumberOfInstances`` | |
130 associates to each series, the number of DICOM instances this series | |
131 is expected to contain. | |
132 * Starting with Orthanc 1.2.0, ``TransferSyntax`` and ``SopClassUid`` | |
133 respectively stores the transfer syntax UID and the SOP class UID of | |
134 DICOM instances, in order to speed up the access to this | |
135 information. | |
136 | |
137 Metadata listed above are set privately by the Orthanc core. They are | |
138 **read-only** from the perspective of the end user, as Orthanc | |
139 internally relies on them. | |
140 | |
141 | |
142 User-defined metadata | |
143 ^^^^^^^^^^^^^^^^^^^^^ | |
144 | |
145 The metadata described above where handled by the core of Orthanc. | |
146 Orthanc users are however allowed to define their own **user-defined | |
147 metadata**. Such metadata are associated with an integer key that is | |
148 greater or equal to 1024 (whereas keys below 1023 are reserved for | |
149 core metadata). | |
150 | |
151 You can associate a symbolic name to user-defined metadata using the | |
152 ``UserMetadata`` option inside the :ref:`configuration of Orthanc | |
92 | 153 <configuration>`:: |
154 | |
155 "UserMetadata" : { | |
156 "SampleMetaData1" : 1024, | |
157 "SampleMetaData2" : 1025 | |
158 } | |
78 | 159 |
160 | |
161 Accessing metadata | |
162 ^^^^^^^^^^^^^^^^^^ | |
163 | |
164 .. highlight:: bash | |
165 | |
166 Metadata associated with one DICOM resource can be accessed through | |
80 | 167 the :ref:`REST API <rest>`, for instance:: |
78 | 168 |
169 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata | |
170 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/RemoteAet | |
92 | 171 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/SampleMetaData1 |
78 | 172 |
173 User-defined metadata can be modified by issuing a HTTP PUT against | |
174 the REST API:: | |
175 | |
176 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/1024 -X PUT -d 'hello' | |
177 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/1024 | |
178 hello | |
179 | |
180 | |
181 | |
92 | 182 .. _attachments: |
183 | |
184 User-defined attachments | |
185 ^^^^^^^^^^^^^^^^^^^^^^^^ | |
186 | |
187 Orthanc users are allowed to define their own **user-defined attachments**. | |
188 Such attachments are associated with an integer key that is | |
189 greater or equal to 1024 (whereas keys below 1023 are reserved for | |
190 core attachments). | |
191 | |
192 You can associate a symbolic name to user-defined attachments using the | |
193 ``UserContentType`` option inside the :ref:`configuration of Orthanc | |
194 <configuration>`. Optionally, the user may specify a MIME content type | |
195 for the attachment:: | |
196 | |
197 "UserContentType" : { | |
198 "samplePdf" : [1024, "application/pdf"], | |
199 "sampleJson" : [1025, "application/json"], | |
200 "sampleRaw" : 1026 | |
201 } | |
202 | |
203 Accessing attachments | |
204 ^^^^^^^^^^^^^^^^^^^^^ | |
205 | |
206 .. highlight:: bash | |
207 | |
208 Attachments associated with one DICOM resource can be accessed through | |
209 the :ref:`REST API <rest>`, for instance:: | |
210 | |
211 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/samplePdf/data | |
212 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/sampleJson/data | |
213 | |
214 User-defined attachments can be modified by issuing a HTTP PUT against | |
215 the REST API:: | |
216 | |
217 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/samplePdf -X PUT --data-binary @sample.pdf | |
218 $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/sampleRaw -X PUT -d 'raw data' | |
219 | |
220 | |
78 | 221 .. _registry: |
222 | |
223 Central registry of metadata and attachments | |
224 -------------------------------------------- | |
225 | |
226 Obviously, one must pay attention to the fact that different | |
227 applications might use the same key to store different user-defined | |
228 :ref:`metadata <metadata>`, which might result in incompatibilities | |
229 between such applications. Similarly, incompatibilities might show up | |
230 for user-defined :ref:`attachments <orthanc-storage>`. | |
231 | |
601
4c19a897803e
global property 5467
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
595
diff
changeset
|
232 Developers of applications/plugins that use user-defined metadata, |
4c19a897803e
global property 5467
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
595
diff
changeset
|
233 attachments or global properties (using |
4c19a897803e
global property 5467
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
595
diff
changeset
|
234 ``OrthancPluginSetGlobalProperty()``) are therefore kindly invited to |
4c19a897803e
global property 5467
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
595
diff
changeset
|
235 complete the **central registry** below: |
78 | 236 |
621
05a5a7369126
documenting attachments 1, 2 and 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
602
diff
changeset
|
237 * ``Attachment 1`` is used by the core of Orthanc to store DICOM instances |
05a5a7369126
documenting attachments 1, 2 and 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
602
diff
changeset
|
238 * ``Attachment 2`` was used by Orthanc <= 1.9.0 to cache the :ref:`DICOM-as-JSON information <orthanc-storage>` |
05a5a7369126
documenting attachments 1, 2 and 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
602
diff
changeset
|
239 * ``Attachment 3`` is used since Orthanc 1.9.1 to store the DICOM instance, until the ``Pixel Data (7fe0,0010)`` tag, |
05a5a7369126
documenting attachments 1, 2 and 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
602
diff
changeset
|
240 if global configuration option ``StorageCompression`` is ``true``, or if the storage area plugin doesn't support |
05a5a7369126
documenting attachments 1, 2 and 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
602
diff
changeset
|
241 range reads |
359 | 242 * ``Attachment 9997`` is used by the :ref:`Osimis WebViewer plugin <osimis_webviewer>` to store series information. |
243 * ``Attachment 9998`` is used by the :ref:`Osimis WebViewer plugin <osimis_webviewer>` to store instance information. | |
244 * ``Attachment 9999`` is used by the :ref:`Osimis WebViewer plugin <osimis_webviewer>` to store annotations. | |
245 * ``Attachments 10000-13999`` are used by the :ref:`Osimis WebViewer plugin <osimis_webviewer>` to store reduced quality images. | |
601
4c19a897803e
global property 5467
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
595
diff
changeset
|
246 * ``Global property 5467`` is used by the Osimis Cloud plugin. |
602
6e7d3f20227b
index global property 5468
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
601
diff
changeset
|
247 * ``Global property 5468`` is used by the :ref:`DICOMweb plugin <dicomweb>` to store the DICOMweb servers into the Orthanc database. |
6e7d3f20227b
index global property 5468
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
601
diff
changeset
|
248 * ``Metadata 4200`` is used by the plugin for :ref:`whole-slide imaging <wsi>` with version <= 0.7. |
6e7d3f20227b
index global property 5468
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
601
diff
changeset
|
249 * ``Metadata 4201`` is used by the plugin for :ref:`whole-slide imaging <wsi>` with version >= 1.0. |
224
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
250 |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
251 |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
252 Jobs |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
253 ---- |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
254 |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
255 Check out the :ref:`advanced features of the REST API <jobs>`. |
02399e86f046
starting documentation of jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
218
diff
changeset
|
256 |