Mercurial > hg > orthanc-stl
annotate Resources/Orthanc/Sdk-1.2.0/orthanc/OrthancCPlugin.h @ 71:f3bbafc067d0
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 04 Oct 2024 17:18:42 +0200 |
parents | 0a408a81fb15 |
children |
rev | line source |
---|---|
49
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * \mainpage |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * This C/C++ SDK allows external developers to create plugins that |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * can be loaded into Orthanc to extend its functionality. Each |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Orthanc plugin must expose 4 public functions with the following |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * signatures: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * This function is invoked by Orthanc when it loads the plugin on startup. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * The plugin must: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * - Check its compatibility with the Orthanc version using |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * ::OrthancPluginCheckVersion(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * - Store the context pointer so that it can use the plugin |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * services of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 * -# <tt>void OrthancPluginFinalize()</tt>: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 * This function is invoked by Orthanc during its shutdown. The plugin |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 * must free all its memory. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 * -# <tt>const char* OrthancPluginGetName()</tt>: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 * The plugin must return a short string to identify itself. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 * -# <tt>const char* OrthancPluginGetVersion()</tt>: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 * The plugin must return a string containing its version number. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 * The name and the version of a plugin is only used to prevent it |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 * from being loaded twice. Note that, in C++, it is mandatory to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 * declare these functions within an <tt>extern "C"</tt> section. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 * To ensure multi-threading safety, the various REST callbacks are |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 * guaranteed to be executed in mutual exclusion since Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 * 0.8.5. If this feature is undesired (notably when developing |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 * high-performance plugins handling simultaneous requests), use |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 * ::OrthancPluginRegisterRestCallbackNoLock(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 * @defgroup Images Images and compression |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 * @brief Functions to deal with images and compressed buffers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 * @defgroup REST REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 * @brief Functions to answer REST requests in a callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 * @defgroup Callbacks Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 * @brief Functions to register and manage callbacks by the plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 * @defgroup DicomCallbaks DicomCallbaks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 * @brief Functions to register and manage DICOM callbacks (worklists, C-Find, C-MOVE). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 * @defgroup Orthanc Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 * @brief Functions to access the content of the Orthanc server. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 * @defgroup Toolbox Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 * @brief Generic functions to help with the creation of plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 * Orthanc - A Lightweight, RESTful DICOM Store |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 * Department, University Hospital of Liege, Belgium |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 * This program is free software: you can redistribute it and/or |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 * modify it under the terms of the GNU General Public License as |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 * published by the Free Software Foundation, either version 3 of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 * License, or (at your option) any later version. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 * In addition, as a special exception, the copyright holders of this |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 * program give permission to link the code of its release with the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 * OpenSSL project's "OpenSSL" library (or with modified versions of it |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 * that use the same license as the "OpenSSL" library), and distribute |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 * the linked executables. You must obey the GNU General Public License |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 * in all respects for all of the code used other than "OpenSSL". If you |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 * modify file(s) with this exception, you may extend this exception to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 * your version of the file(s), but you are not obligated to do so. If |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 * you do not wish to do so, delete this exception statement from your |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 * version. If you delete this exception statement from all source files |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 * in the program, then also delete it here. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 * This program is distributed in the hope that it will be useful, but |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 * WITHOUT ANY WARRANTY; without even the implied warranty of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 * General Public License for more details. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 * You should have received a copy of the GNU General Public License |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 #pragma once |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 #include <stdio.h> |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 #include <string.h> |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 #ifdef WIN32 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 #define ORTHANC_PLUGINS_API __declspec(dllexport) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 #else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 #define ORTHANC_PLUGINS_API |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 #endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 2 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 /******************************************************************** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 ** Check that function inlining is properly supported. The use of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 ** inlining is required, to avoid the duplication of object code |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 ** between two compilation modules that would use the Orthanc Plugin |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 ** API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 ********************************************************************/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 /* If the auto-detection of the "inline" keyword below does not work |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 automatically and that your compiler is known to properly support |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 inlining, uncomment the following #define and adapt the definition |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 of "static inline". */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 /* #define ORTHANC_PLUGIN_INLINE static inline */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 #ifndef ORTHANC_PLUGIN_INLINE |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 # if __STDC_VERSION__ >= 199901L |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 # define ORTHANC_PLUGIN_INLINE static inline |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 # elif defined(__cplusplus) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 /* This is C++ */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 # define ORTHANC_PLUGIN_INLINE static inline |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 # elif defined(__GNUC__) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 /* This is GCC running in C89 mode */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 # define ORTHANC_PLUGIN_INLINE static __inline |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 # elif defined(_MSC_VER) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 /* This is Visual Studio running in C89 mode */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 # define ORTHANC_PLUGIN_INLINE static __inline |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 # else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 # error Your compiler is not known to support the "inline" keyword |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 # endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 #endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 /******************************************************************** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 ** Inclusion of standard libraries. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 ********************************************************************/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 * For Microsoft Visual Studio, a compatibility "stdint.h" can be |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 * downloaded at the following URL: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 #include <stdint.h> |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 #include <stdlib.h> |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 /******************************************************************** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 ** Definition of the Orthanc Plugin API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 ********************************************************************/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 /** @{ */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 #ifdef __cplusplus |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 extern "C" |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 #endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 * The various error codes that can be returned by the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 OrthancPluginErrorCode_Success = 0 /*!< Success */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
287 } OrthancPluginErrorCode; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
288 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
289 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
290 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
291 * Forward declaration of one of the mandatory functions for Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 * plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
294 ORTHANC_PLUGINS_API const char* OrthancPluginGetName(); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 * The various HTTP methods for a REST call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
299 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
300 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
302 OrthancPluginHttpMethod_Get = 1, /*!< GET request */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 OrthancPluginHttpMethod_Post = 2, /*!< POST request */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
304 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
305 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
306 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
307 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
308 } OrthancPluginHttpMethod; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
309 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
311 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
312 * @brief The parameters of a REST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
313 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
314 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
315 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
316 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
317 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 * @brief The HTTP method. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
319 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 OrthancPluginHttpMethod method; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
321 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
322 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
323 * @brief The number of groups of the regular expression. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
324 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
325 uint32_t groupsCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
326 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
327 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 * @brief The matched values for the groups of the regular expression. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
330 const char* const* groups; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
333 * @brief For a GET request, the number of GET parameters. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
334 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
335 uint32_t getCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
336 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
337 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
338 * @brief For a GET request, the keys of the GET parameters. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 const char* const* getKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
342 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
343 * @brief For a GET request, the values of the GET parameters. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
345 const char* const* getValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 * @brief For a PUT or POST request, the content of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 const char* body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 * @brief For a PUT or POST request, the number of bytes of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 uint32_t bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 /* -------------------------------------------------- |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 New in version 0.8.1 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 -------------------------------------------------- */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 * @brief The number of HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 uint32_t headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
366 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 * @brief The keys of the HTTP headers (always converted to low-case). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 const char* const* headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 * @brief The values of the HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
374 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 const char* const* headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 } OrthancPluginHttpRequest; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
379 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
380 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
381 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
382 /* Generic services */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
383 _OrthancPluginService_LogInfo = 1, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
384 _OrthancPluginService_LogWarning = 2, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
385 _OrthancPluginService_LogError = 3, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
386 _OrthancPluginService_GetOrthancPath = 4, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 _OrthancPluginService_GetOrthancDirectory = 5, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 _OrthancPluginService_GetConfigurationPath = 6, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
389 _OrthancPluginService_SetPluginProperty = 7, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 _OrthancPluginService_GetGlobalProperty = 8, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
391 _OrthancPluginService_SetGlobalProperty = 9, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 _OrthancPluginService_GetCommandLineArgumentsCount = 10, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
393 _OrthancPluginService_GetCommandLineArgument = 11, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
394 _OrthancPluginService_GetExpectedDatabaseVersion = 12, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 _OrthancPluginService_GetConfiguration = 13, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
396 _OrthancPluginService_BufferCompression = 14, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 _OrthancPluginService_ReadFile = 15, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 _OrthancPluginService_WriteFile = 16, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 _OrthancPluginService_GetErrorDescription = 17, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 _OrthancPluginService_CallHttpClient = 18, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
401 _OrthancPluginService_RegisterErrorCode = 19, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
402 _OrthancPluginService_RegisterDictionaryTag = 20, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 _OrthancPluginService_DicomBufferToJson = 21, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
404 _OrthancPluginService_DicomInstanceToJson = 22, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
405 _OrthancPluginService_CreateDicom = 23, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
406 _OrthancPluginService_ComputeMd5 = 24, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
407 _OrthancPluginService_ComputeSha1 = 25, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
408 _OrthancPluginService_LookupDictionary = 26, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
409 _OrthancPluginService_CallHttpClient2 = 27, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
410 _OrthancPluginService_GenerateUuid = 28, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 _OrthancPluginService_RegisterPrivateDictionaryTag = 29, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
413 /* Registration of callbacks */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
414 _OrthancPluginService_RegisterRestCallback = 1000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
415 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
416 _OrthancPluginService_RegisterStorageArea = 1002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
417 _OrthancPluginService_RegisterOnChangeCallback = 1003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
418 _OrthancPluginService_RegisterRestCallbackNoLock = 1004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
419 _OrthancPluginService_RegisterWorklistCallback = 1005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
420 _OrthancPluginService_RegisterDecodeImageCallback = 1006, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
421 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
422 _OrthancPluginService_RegisterFindCallback = 1008, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
423 _OrthancPluginService_RegisterMoveCallback = 1009, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
424 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
425 /* Sending answers to REST calls */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
426 _OrthancPluginService_AnswerBuffer = 2000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
427 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
428 _OrthancPluginService_Redirect = 2002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
429 _OrthancPluginService_SendHttpStatusCode = 2003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
430 _OrthancPluginService_SendUnauthorized = 2004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 _OrthancPluginService_SendMethodNotAllowed = 2005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 _OrthancPluginService_SetCookie = 2006, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
433 _OrthancPluginService_SetHttpHeader = 2007, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
434 _OrthancPluginService_StartMultipartAnswer = 2008, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
435 _OrthancPluginService_SendMultipartItem = 2009, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
436 _OrthancPluginService_SendHttpStatus = 2010, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
437 _OrthancPluginService_CompressAndAnswerImage = 2011, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
438 _OrthancPluginService_SendMultipartItem2 = 2012, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
439 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
440 /* Access to the Orthanc database and API */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
441 _OrthancPluginService_GetDicomForInstance = 3000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
442 _OrthancPluginService_RestApiGet = 3001, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
443 _OrthancPluginService_RestApiPost = 3002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
444 _OrthancPluginService_RestApiDelete = 3003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
445 _OrthancPluginService_RestApiPut = 3004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
446 _OrthancPluginService_LookupPatient = 3005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
447 _OrthancPluginService_LookupStudy = 3006, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
448 _OrthancPluginService_LookupSeries = 3007, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
449 _OrthancPluginService_LookupInstance = 3008, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
450 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
451 _OrthancPluginService_RestApiGetAfterPlugins = 3010, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
452 _OrthancPluginService_RestApiPostAfterPlugins = 3011, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
453 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
454 _OrthancPluginService_RestApiPutAfterPlugins = 3013, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
455 _OrthancPluginService_ReconstructMainDicomTags = 3014, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
456 _OrthancPluginService_RestApiGet2 = 3015, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
457 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
458 /* Access to DICOM instances */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
459 _OrthancPluginService_GetInstanceRemoteAet = 4000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
460 _OrthancPluginService_GetInstanceSize = 4001, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
461 _OrthancPluginService_GetInstanceData = 4002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
462 _OrthancPluginService_GetInstanceJson = 4003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
463 _OrthancPluginService_GetInstanceSimplifiedJson = 4004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
464 _OrthancPluginService_HasInstanceMetadata = 4005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
465 _OrthancPluginService_GetInstanceMetadata = 4006, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
466 _OrthancPluginService_GetInstanceOrigin = 4007, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
467 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
468 /* Services for plugins implementing a database back-end */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
469 _OrthancPluginService_RegisterDatabaseBackend = 5000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
470 _OrthancPluginService_DatabaseAnswer = 5001, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
471 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
472 _OrthancPluginService_StorageAreaCreate = 5003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
473 _OrthancPluginService_StorageAreaRead = 5004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
474 _OrthancPluginService_StorageAreaRemove = 5005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
475 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
476 /* Primitives for handling images */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
477 _OrthancPluginService_GetImagePixelFormat = 6000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
478 _OrthancPluginService_GetImageWidth = 6001, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
479 _OrthancPluginService_GetImageHeight = 6002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
480 _OrthancPluginService_GetImagePitch = 6003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
481 _OrthancPluginService_GetImageBuffer = 6004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
482 _OrthancPluginService_UncompressImage = 6005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
483 _OrthancPluginService_FreeImage = 6006, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
484 _OrthancPluginService_CompressImage = 6007, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
485 _OrthancPluginService_ConvertPixelFormat = 6008, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
486 _OrthancPluginService_GetFontsCount = 6009, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
487 _OrthancPluginService_GetFontInfo = 6010, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
488 _OrthancPluginService_DrawText = 6011, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
489 _OrthancPluginService_CreateImage = 6012, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
490 _OrthancPluginService_CreateImageAccessor = 6013, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
491 _OrthancPluginService_DecodeDicomImage = 6014, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
492 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
493 /* Primitives for handling C-Find, C-Move and worklists */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
494 _OrthancPluginService_WorklistAddAnswer = 7000, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
495 _OrthancPluginService_WorklistMarkIncomplete = 7001, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
496 _OrthancPluginService_WorklistIsMatch = 7002, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
497 _OrthancPluginService_WorklistGetDicomQuery = 7003, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
498 _OrthancPluginService_FindAddAnswer = 7004, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
499 _OrthancPluginService_FindMarkIncomplete = 7005, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
500 _OrthancPluginService_GetFindQuerySize = 7006, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
501 _OrthancPluginService_GetFindQueryTag = 7007, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
502 _OrthancPluginService_GetFindQueryTagName = 7008, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
503 _OrthancPluginService_GetFindQueryValue = 7009, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
504 _OrthancPluginService_CreateFindMatcher = 7010, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
505 _OrthancPluginService_FreeFindMatcher = 7011, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
506 _OrthancPluginService_FindMatcherIsMatch = 7012, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
507 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
508 _OrthancPluginService_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
509 } _OrthancPluginService; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
510 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
511 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
512 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
513 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
514 _OrthancPluginProperty_Description = 1, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
515 _OrthancPluginProperty_RootUri = 2, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
516 _OrthancPluginProperty_OrthancExplorer = 3, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
517 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
518 _OrthancPluginProperty_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
519 } _OrthancPluginProperty; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
520 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
521 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
522 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
523 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
524 * The memory layout of the pixels of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
525 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
526 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
527 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
528 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
529 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
530 * @brief Graylevel 8bpp image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
531 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
532 * The image is graylevel. Each pixel is unsigned and stored in |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
533 * one byte. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
534 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
535 OrthancPluginPixelFormat_Grayscale8 = 1, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
536 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
537 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
538 * @brief Graylevel, unsigned 16bpp image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
539 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
540 * The image is graylevel. Each pixel is unsigned and stored in |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
541 * two bytes. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
542 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
543 OrthancPluginPixelFormat_Grayscale16 = 2, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
544 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
545 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
546 * @brief Graylevel, signed 16bpp image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
547 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
548 * The image is graylevel. Each pixel is signed and stored in two |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
549 * bytes. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
550 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
551 OrthancPluginPixelFormat_SignedGrayscale16 = 3, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
552 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
553 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
554 * @brief Color image in RGB24 format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
555 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
556 * This format describes a color image. The pixels are stored in 3 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
557 * consecutive bytes. The memory layout is RGB. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
558 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
559 OrthancPluginPixelFormat_RGB24 = 4, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
560 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
561 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
562 * @brief Color image in RGBA32 format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
563 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
564 * This format describes a color image. The pixels are stored in 4 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
565 * consecutive bytes. The memory layout is RGBA. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
566 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
567 OrthancPluginPixelFormat_RGBA32 = 5, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
568 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
569 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
570 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
571 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
572 } OrthancPluginPixelFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
573 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
574 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
575 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
576 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
577 * The content types that are supported by Orthanc plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
578 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
579 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
580 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
581 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
582 OrthancPluginContentType_Dicom = 1, /*!< DICOM */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
583 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
584 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
585 _OrthancPluginContentType_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
586 } OrthancPluginContentType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
587 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
588 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
589 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
590 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
591 * The supported types of DICOM resources. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
592 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
593 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
594 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
595 OrthancPluginResourceType_Patient = 0, /*!< Patient */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
596 OrthancPluginResourceType_Study = 1, /*!< Study */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
597 OrthancPluginResourceType_Series = 2, /*!< Series */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
598 OrthancPluginResourceType_Instance = 3, /*!< Instance */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
599 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
600 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
601 _OrthancPluginResourceType_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
602 } OrthancPluginResourceType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
603 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
604 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
605 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
606 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
607 * The supported types of changes that can happen to DICOM resources. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
608 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
609 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
610 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
611 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
612 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
613 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
614 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
615 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
616 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
617 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
618 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
619 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
620 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
621 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
622 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
623 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
624 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
625 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
626 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
627 _OrthancPluginChangeType_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
628 } OrthancPluginChangeType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
629 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
630 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
631 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
632 * The compression algorithms that are supported by the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
633 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
634 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
635 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
636 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
637 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
638 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
639 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
640 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
641 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
642 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
643 } OrthancPluginCompressionType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
644 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
645 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
646 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
647 * The image formats that are supported by the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
648 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
649 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
650 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
651 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
652 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
653 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
654 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
655 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
656 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
657 } OrthancPluginImageFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
658 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
659 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
660 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
661 * The value representations present in the DICOM standard (version 2013). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
662 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
663 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
664 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
665 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
666 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
667 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
668 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
669 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
670 OrthancPluginValueRepresentation_DA = 5, /*!< Date */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
671 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
672 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
673 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
674 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
675 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
676 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
677 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
678 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
679 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
680 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
681 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
682 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
683 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
684 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
685 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
686 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
687 OrthancPluginValueRepresentation_TM = 22, /*!< Time */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
688 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
689 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
690 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
691 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
692 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
693 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
694 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
695 } OrthancPluginValueRepresentation; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
696 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
697 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
698 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
699 * The possible output formats for a DICOM-to-JSON conversion. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
700 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
701 * @see OrthancPluginDicomToJson() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
702 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
703 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
704 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
705 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
706 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
707 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
708 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
709 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
710 } OrthancPluginDicomToJsonFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
711 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
712 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
713 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
714 * Flags to customize a DICOM-to-JSON conversion. By default, binary |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
715 * tags are formatted using Data URI scheme. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
716 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
717 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
718 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
719 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
720 OrthancPluginDicomToJsonFlags_None = 0, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
721 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
722 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
723 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
724 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
725 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
726 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
727 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
728 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
729 } OrthancPluginDicomToJsonFlags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
730 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
731 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
732 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
733 * Flags to the creation of a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
734 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
735 * @see OrthancPluginCreateDicom() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
736 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
737 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
738 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
739 OrthancPluginCreateDicomFlags_None = 0, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
740 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
741 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
742 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
743 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
744 } OrthancPluginCreateDicomFlags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
745 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
746 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
747 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
748 * The constraints on the DICOM identifiers that must be supported |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
749 * by the database plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
750 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
751 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
752 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
753 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
754 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
755 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
756 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
757 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
758 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
759 } OrthancPluginIdentifierConstraint; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
760 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
761 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
762 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
763 * The origin of a DICOM instance that has been received by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
764 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
765 typedef enum |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
766 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
767 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
768 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
769 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
770 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
771 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
772 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
773 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
774 } OrthancPluginInstanceOrigin; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
775 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
776 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
777 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
778 * @brief A memory buffer allocated by the core system of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
779 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
780 * A memory buffer allocated by the core system of Orthanc. When the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
781 * content of the buffer is not useful anymore, it must be free by a |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
782 * call to ::OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
783 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
784 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
785 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
786 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
787 * @brief The content of the buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
788 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
789 void* data; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
790 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
791 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
792 * @brief The number of bytes in the buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
793 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
794 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
795 } OrthancPluginMemoryBuffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
796 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
797 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
798 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
799 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
800 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
801 * @brief Opaque structure that represents the HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
802 * @ingroup Callback |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
803 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
804 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
805 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
806 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
807 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
808 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
809 * @brief Opaque structure that represents a DICOM instance received by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
810 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
811 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
812 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
813 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
814 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
815 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
816 * @brief Opaque structure that represents an image that is uncompressed in memory. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
817 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
818 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
819 typedef struct _OrthancPluginImage_t OrthancPluginImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
820 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
821 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
822 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
823 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
824 * @brief Opaque structure that represents the storage area that is actually used by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
825 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
826 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
827 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
828 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
829 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
830 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
831 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
832 * @brief Opaque structure to an object that represents a C-Find query for worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
833 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
834 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
835 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
836 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
837 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
838 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
839 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
840 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
841 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
842 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
843 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
844 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
845 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
846 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
847 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
848 * @brief Opaque structure to an object that represents a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
849 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
850 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
851 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
852 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
853 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
854 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
855 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
856 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
857 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
858 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
859 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
860 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
861 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
862 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
863 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
864 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
865 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
866 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
867 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
868 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
869 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
870 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
871 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
872 * @brief Signature of a callback function that answers to a REST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
873 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
874 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
875 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
876 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
877 const char* url, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
878 const OrthancPluginHttpRequest* request); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
879 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
880 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
881 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
882 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
883 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
884 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
885 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
886 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
887 OrthancPluginDicomInstance* instance, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
888 const char* instanceId); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
889 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
890 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
891 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
892 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
893 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
894 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
895 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
896 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
897 OrthancPluginChangeType changeType, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
898 OrthancPluginResourceType resourceType, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
899 const char* resourceId); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
900 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
901 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
902 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
903 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
904 * @brief Signature of a callback function to decode a DICOM instance as an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
905 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
906 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
907 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
908 OrthancPluginImage** target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
909 const void* dicom, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
910 const uint32_t size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
911 uint32_t frameIndex); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
912 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
913 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
914 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
915 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
916 * @brief Signature of a function to free dynamic memory. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
917 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
918 typedef void (*OrthancPluginFree) (void* buffer); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
919 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
920 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
921 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
922 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
923 * @brief Callback for writing to the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
924 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
925 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
926 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
927 * @param uuid The UUID of the file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
928 * @param content The content of the file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
929 * @param size The size of the file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
930 * @param type The content type corresponding to this file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
931 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
932 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
933 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
934 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
935 const char* uuid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
936 const void* content, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
937 int64_t size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
938 OrthancPluginContentType type); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
939 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
940 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
941 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
942 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
943 * @brief Callback for reading from the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
944 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
945 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
946 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
947 * @param content The content of the file (output). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
948 * @param size The size of the file (output). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
949 * @param uuid The UUID of the file of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
950 * @param type The content type corresponding to this file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
951 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
952 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
953 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
954 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
955 void** content, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
956 int64_t* size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
957 const char* uuid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
958 OrthancPluginContentType type); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
959 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
960 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
961 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
962 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
963 * @brief Callback for removing a file from the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
964 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
965 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
966 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
967 * @param uuid The UUID of the file to be removed. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
968 * @param type The content type corresponding to this file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
969 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
970 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
971 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
972 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
973 const char* uuid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
974 OrthancPluginContentType type); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
975 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
976 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
977 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
978 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
979 * @brief Callback to handle the C-Find SCP requests for worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
980 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
981 * Signature of a callback function that is triggered when Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
982 * receives a C-Find SCP request against modality worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
983 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
984 * @param answers The target structure where answers must be stored. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
985 * @param query The worklist query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
986 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
987 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
988 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
989 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
990 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
991 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
992 OrthancPluginWorklistAnswers* answers, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
993 const OrthancPluginWorklistQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
994 const char* issuerAet, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
995 const char* calledAet); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
996 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
997 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
998 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
999 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1000 * @brief Callback to filter incoming HTTP requests received by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1001 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1002 * Signature of a callback function that is triggered whenever |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1003 * Orthanc receives an HTTP/REST request, and that answers whether |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1004 * this request should be allowed. If the callback returns "0" |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1005 * ("false"), the server answers with HTTP status code 403 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1006 * (Forbidden). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1007 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1008 * @param method The HTTP method used by the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1009 * @param uri The URI of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1010 * @param ip The IP address of the HTTP client. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1011 * @param headersCount The number of HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1012 * @param headersKeys The keys of the HTTP headers (always converted to low-case). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1013 * @param headersValues The values of the HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1014 * @return 0 if forbidden access, 1 if allowed access, -1 if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1015 * @ingroup Callback |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1016 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1017 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1018 OrthancPluginHttpMethod method, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1019 const char* uri, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1020 const char* ip, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1021 uint32_t headersCount, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1022 const char* const* headersKeys, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1023 const char* const* headersValues); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1024 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1025 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1026 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1027 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1028 * @brief Callback to handle incoming C-Find SCP requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1029 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1030 * Signature of a callback function that is triggered whenever |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1031 * Orthanc receives a C-Find SCP request not concerning modality |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1032 * worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1033 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1034 * @param answers The target structure where answers must be stored. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1035 * @param query The worklist query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1036 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1037 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1038 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1039 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1040 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1041 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1042 OrthancPluginFindAnswers* answers, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1043 const OrthancPluginFindQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1044 const char* issuerAet, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1045 const char* calledAet); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1046 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1047 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1048 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1049 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1050 * @brief Callback to handle incoming C-Move SCP requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1051 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1052 * Signature of a callback function that is triggered whenever |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1053 * Orthanc receives a C-Move SCP request. The callback receives the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1054 * type of the resource of interest (study, series, instance...) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1055 * together with the DICOM tags containing its identifiers. In turn, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1056 * the plugin must create a driver object that will be responsible |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1057 * for driving the successive move suboperations. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1058 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1059 * @param resourceType The type of the resource of interest. Note |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1060 * that this might be set to ResourceType_None if the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1061 * QueryRetrieveLevel (0008,0052) tag was not provided by the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1062 * issuer (i.e. the originator modality). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1063 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1064 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1065 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1066 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1067 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1068 * @param originatorAet The Application Entity Title (AET) of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1069 * modality from which the request originates. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1070 * @param sourceAet The Application Entity Title (AET) of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1071 * modality that should send its DICOM files to another modality. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1072 * @param targetAet The Application Entity Title (AET) of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1073 * modality that should receive the DICOM files. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1074 * @param originatorId The Message ID issued by the originator modality, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1075 * as found in tag (0000,0110) of the DICOM query emitted by the issuer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1076 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1077 * @return The NULL value if the plugin cannot deal with this query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1078 * or a pointer to the driver object that is responsible for |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1079 * handling the successive move suboperations. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1080 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1081 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1082 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1083 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1084 typedef void* (*OrthancPluginMoveCallback) ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1085 OrthancPluginResourceType resourceType, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1086 const char* patientId, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1087 const char* accessionNumber, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1088 const char* studyInstanceUid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1089 const char* seriesInstanceUid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1090 const char* sopInstanceUid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1091 const char* originatorAet, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1092 const char* sourceAet, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1093 const char* targetAet, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1094 uint16_t originatorId); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1095 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1096 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1097 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1098 * @brief Callback to read the size of a C-Move driver. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1099 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1100 * Signature of a callback function that returns the number of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1101 * C-Move suboperations that are to be achieved by the given C-Move |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1102 * driver. This driver is the return value of a previous call to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1103 * OrthancPluginMoveCallback() callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1104 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1105 * @param moveDriver The C-Move driver of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1106 * @return The number of suboperations. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1107 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1108 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1109 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1110 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1111 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1112 * @brief Callback to apply one C-Move suboperation. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1113 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1114 * Signature of a callback function that applies the next C-Move |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1115 * suboperation that os to be achieved by the given C-Move |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1116 * driver. This driver is the return value of a previous call to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1117 * OrthancPluginMoveCallback() callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1118 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1119 * @param moveDriver The C-Move driver of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1120 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1121 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1122 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1123 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1124 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1125 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1126 * @brief Callback to free one C-Move driver. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1127 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1128 * Signature of a callback function that releases the resources |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1129 * allocated by the given C-Move driver. This driver is the return |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1130 * value of a previous call to the OrthancPluginMoveCallback() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1131 * callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1132 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1133 * @param moveDriver The C-Move driver of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1134 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1135 typedef void (*OrthancPluginFreeMove) (void* moveDriver); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1136 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1137 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1138 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1139 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1140 * @brief Data structure that contains information about the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1141 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1142 typedef struct _OrthancPluginContext_t |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1143 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1144 void* pluginsManager; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1145 const char* orthancVersion; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1146 OrthancPluginFree Free; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1147 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1148 _OrthancPluginService service, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1149 const void* params); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1150 } OrthancPluginContext; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1151 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1152 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1153 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1154 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1155 * @brief An entry in the dictionary of DICOM tags. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1156 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1157 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1158 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1159 uint16_t group; /*!< The group of the tag */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1160 uint16_t element; /*!< The element of the tag */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1161 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1162 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1163 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1164 } OrthancPluginDictionaryEntry; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1165 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1166 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1167 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1168 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1169 * @brief Free a string. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1170 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1171 * Free a string that was allocated by the core system of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1172 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1173 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1174 * @param str The string to be freed. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1175 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1176 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1177 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1178 char* str) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1179 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1180 if (str != NULL) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1181 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1182 context->Free(str); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1183 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1184 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1185 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1186 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1187 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1188 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1189 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1190 * This function checks whether the version of this C header is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1191 * compatible with the current version of Orthanc. The result of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1192 * this function should always be checked in the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1193 * OrthancPluginInitialize() entry point of the plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1194 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1195 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1196 * @return 1 if and only if the versions are compatible. If the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1197 * result is 0, the initialization of the plugin should fail. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1198 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1199 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1200 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1201 OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1202 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1203 int major, minor, revision; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1204 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1205 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1206 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1207 sizeof(int32_t) != sizeof(_OrthancPluginService) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1208 sizeof(int32_t) != sizeof(_OrthancPluginProperty) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1209 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1210 sizeof(int32_t) != sizeof(OrthancPluginContentType) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1211 sizeof(int32_t) != sizeof(OrthancPluginResourceType) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1212 sizeof(int32_t) != sizeof(OrthancPluginChangeType) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1213 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1214 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1215 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1216 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1217 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1218 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1219 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1220 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin)) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1221 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1222 /* Mismatch in the size of the enumerations */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1223 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1224 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1225 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1226 /* Assume compatibility with the mainline */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1227 if (!strcmp(context->orthancVersion, "mainline")) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1228 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1229 return 1; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1230 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1231 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1232 /* Parse the version of the Orthanc core */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1233 if ( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1234 #ifdef _MSC_VER |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1235 sscanf_s |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1236 #else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1237 sscanf |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1238 #endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1239 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1240 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1241 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1242 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1243 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1244 /* Check the major number of the version */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1245 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1246 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1247 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1248 return 1; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1249 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1250 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1251 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1252 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1253 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1254 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1255 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1256 /* Check the minor number of the version */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1257 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1258 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1259 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1260 return 1; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1261 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1262 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1263 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1264 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1265 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1266 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1267 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1268 /* Check the revision number of the version */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1269 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1270 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1271 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1272 return 1; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1273 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1274 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1275 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1276 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1277 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1278 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1279 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1280 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1281 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1282 * @brief Free a memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1283 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1284 * Free a memory buffer that was allocated by the core system of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1285 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1286 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1287 * @param buffer The memory buffer to release. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1288 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1289 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1290 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1291 OrthancPluginMemoryBuffer* buffer) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1292 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1293 context->Free(buffer->data); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1294 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1295 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1296 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1297 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1298 * @brief Log an error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1299 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1300 * Log an error message using the Orthanc logging system. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1301 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1302 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1303 * @param message The message to be logged. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1304 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1305 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1306 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1307 const char* message) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1308 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1309 context->InvokeService(context, _OrthancPluginService_LogError, message); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1310 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1311 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1312 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1313 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1314 * @brief Log a warning. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1315 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1316 * Log a warning message using the Orthanc logging system. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1317 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1318 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1319 * @param message The message to be logged. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1320 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1321 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1322 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1323 const char* message) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1324 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1325 context->InvokeService(context, _OrthancPluginService_LogWarning, message); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1326 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1327 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1328 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1329 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1330 * @brief Log an information. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1331 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1332 * Log an information message using the Orthanc logging system. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1333 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1334 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1335 * @param message The message to be logged. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1336 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1337 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1338 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1339 const char* message) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1340 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1341 context->InvokeService(context, _OrthancPluginService_LogInfo, message); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1342 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1343 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1344 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1345 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1346 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1347 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1348 const char* pathRegularExpression; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1349 OrthancPluginRestCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1350 } _OrthancPluginRestCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1351 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1352 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1353 * @brief Register a REST callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1354 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1355 * This function registers a REST callback against a regular |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1356 * expression for a URI. This function must be called during the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1357 * initialization of the plugin, i.e. inside the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1358 * OrthancPluginInitialize() public function. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1359 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1360 * Each REST callback is guaranteed to run in mutual exclusion. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1361 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1362 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1363 * @param pathRegularExpression Regular expression for the URI. May contain groups. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1364 * @param callback The callback function to handle the REST call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1365 * @see OrthancPluginRegisterRestCallbackNoLock() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1366 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1367 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1368 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1369 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1370 const char* pathRegularExpression, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1371 OrthancPluginRestCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1372 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1373 _OrthancPluginRestCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1374 params.pathRegularExpression = pathRegularExpression; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1375 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1376 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1377 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1378 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1379 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1380 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1381 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1382 * @brief Register a REST callback, without locking. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1383 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1384 * This function registers a REST callback against a regular |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1385 * expression for a URI. This function must be called during the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1386 * initialization of the plugin, i.e. inside the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1387 * OrthancPluginInitialize() public function. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1388 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1389 * Contrarily to OrthancPluginRegisterRestCallback(), the callback |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1390 * will NOT be invoked in mutual exclusion. This can be useful for |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1391 * high-performance plugins that must handle concurrent requests |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1392 * (Orthanc uses a pool of threads, one thread being assigned to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1393 * each incoming HTTP request). Of course, it is up to the plugin to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1394 * implement the required locking mechanisms. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1395 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1396 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1397 * @param pathRegularExpression Regular expression for the URI. May contain groups. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1398 * @param callback The callback function to handle the REST call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1399 * @see OrthancPluginRegisterRestCallback() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1400 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1401 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1402 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1403 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1404 const char* pathRegularExpression, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1405 OrthancPluginRestCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1406 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1407 _OrthancPluginRestCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1408 params.pathRegularExpression = pathRegularExpression; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1409 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1410 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1411 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1412 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1413 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1414 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1415 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1416 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1417 OrthancPluginOnStoredInstanceCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1418 } _OrthancPluginOnStoredInstanceCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1419 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1420 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1421 * @brief Register a callback for received instances. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1422 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1423 * This function registers a callback function that is called |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1424 * whenever a new DICOM instance is stored into the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1425 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1426 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1427 * @param callback The callback function. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1428 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1429 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1430 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1431 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1432 OrthancPluginOnStoredInstanceCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1433 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1434 _OrthancPluginOnStoredInstanceCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1435 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1436 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1437 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1438 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1439 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1440 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1441 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1442 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1443 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1444 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1445 const char* answer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1446 uint32_t answerSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1447 const char* mimeType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1448 } _OrthancPluginAnswerBuffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1449 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1450 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1451 * @brief Answer to a REST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1452 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1453 * This function answers to a REST request with the content of a memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1454 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1455 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1456 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1457 * @param answer Pointer to the memory buffer containing the answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1458 * @param answerSize Number of bytes of the answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1459 * @param mimeType The MIME type of the answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1460 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1461 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1462 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1463 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1464 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1465 const char* answer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1466 uint32_t answerSize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1467 const char* mimeType) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1468 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1469 _OrthancPluginAnswerBuffer params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1470 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1471 params.answer = answer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1472 params.answerSize = answerSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1473 params.mimeType = mimeType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1474 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1475 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1476 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1477 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1478 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1479 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1480 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1481 OrthancPluginPixelFormat format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1482 uint32_t width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1483 uint32_t height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1484 uint32_t pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1485 const void* buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1486 } _OrthancPluginCompressAndAnswerPngImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1487 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1488 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1489 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1490 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1491 OrthancPluginImageFormat imageFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1492 OrthancPluginPixelFormat pixelFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1493 uint32_t width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1494 uint32_t height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1495 uint32_t pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1496 const void* buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1497 uint8_t quality; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1498 } _OrthancPluginCompressAndAnswerImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1499 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1500 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1501 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1502 * @brief Answer to a REST request with a PNG image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1503 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1504 * This function answers to a REST request with a PNG image. The |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1505 * parameters of this function describe a memory buffer that |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1506 * contains an uncompressed image. The image will be automatically compressed |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1507 * as a PNG image by the core system of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1508 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1509 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1510 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1511 * @param format The memory layout of the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1512 * @param width The width of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1513 * @param height The height of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1514 * @param pitch The pitch of the image (i.e. the number of bytes |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1515 * between 2 successive lines of the image in the memory buffer). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1516 * @param buffer The memory buffer containing the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1517 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1518 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1519 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1520 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1521 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1522 OrthancPluginPixelFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1523 uint32_t width, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1524 uint32_t height, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1525 uint32_t pitch, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1526 const void* buffer) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1527 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1528 _OrthancPluginCompressAndAnswerImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1529 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1530 params.imageFormat = OrthancPluginImageFormat_Png; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1531 params.pixelFormat = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1532 params.width = width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1533 params.height = height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1534 params.pitch = pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1535 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1536 params.quality = 0; /* No quality for PNG */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1537 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1538 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1539 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1540 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1541 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1542 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1543 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1544 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1545 const char* instanceId; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1546 } _OrthancPluginGetDicomForInstance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1547 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1548 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1549 * @brief Retrieve a DICOM instance using its Orthanc identifier. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1550 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1551 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1552 * file is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1553 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1554 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1555 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1556 * @param instanceId The Orthanc identifier of the DICOM instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1557 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1558 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1559 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1560 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1561 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1562 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1563 const char* instanceId) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1564 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1565 _OrthancPluginGetDicomForInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1566 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1567 params.instanceId = instanceId; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1568 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1569 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1570 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1571 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1572 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1573 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1574 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1575 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1576 const char* uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1577 } _OrthancPluginRestApiGet; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1578 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1579 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1580 * @brief Make a GET call to the built-in Orthanc REST API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1581 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1582 * Make a GET call to the built-in Orthanc REST API. The result to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1583 * the query is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1584 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1585 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1586 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1587 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1588 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1589 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1590 * @see OrthancPluginRestApiGetAfterPlugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1591 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1592 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1593 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1594 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1595 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1596 const char* uri) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1597 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1598 _OrthancPluginRestApiGet params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1599 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1600 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1601 return context->InvokeService(context, _OrthancPluginService_RestApiGet, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1602 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1603 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1604 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1605 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1606 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1607 * @brief Make a GET call to the REST API, as tainted by the plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1608 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1609 * Make a GET call to the Orthanc REST API, after all the plugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1610 * are applied. In other words, if some plugin overrides or adds the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1611 * called URI to the built-in Orthanc REST API, this call will |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1612 * return the result provided by this plugin. The result to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1613 * query is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1614 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1615 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1616 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1617 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1618 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1619 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1620 * @see OrthancPluginRestApiGet |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1621 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1622 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1623 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1624 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1625 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1626 const char* uri) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1627 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1628 _OrthancPluginRestApiGet params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1629 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1630 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1631 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1632 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1633 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1634 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1635 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1636 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1637 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1638 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1639 const char* uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1640 const char* body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1641 uint32_t bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1642 } _OrthancPluginRestApiPostPut; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1643 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1644 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1645 * @brief Make a POST call to the built-in Orthanc REST API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1646 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1647 * Make a POST call to the built-in Orthanc REST API. The result to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1648 * the query is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1649 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1650 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1651 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1652 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1653 * @param body The body of the POST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1654 * @param bodySize The size of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1655 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1656 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1657 * @see OrthancPluginRestApiPostAfterPlugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1658 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1659 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1660 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1661 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1662 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1663 const char* uri, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1664 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1665 uint32_t bodySize) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1666 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1667 _OrthancPluginRestApiPostPut params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1668 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1669 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1670 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1671 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1672 return context->InvokeService(context, _OrthancPluginService_RestApiPost, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1673 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1674 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1675 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1676 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1677 * @brief Make a POST call to the REST API, as tainted by the plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1678 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1679 * Make a POST call to the Orthanc REST API, after all the plugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1680 * are applied. In other words, if some plugin overrides or adds the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1681 * called URI to the built-in Orthanc REST API, this call will |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1682 * return the result provided by this plugin. The result to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1683 * query is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1684 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1685 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1686 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1687 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1688 * @param body The body of the POST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1689 * @param bodySize The size of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1690 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1691 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1692 * @see OrthancPluginRestApiPost |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1693 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1694 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1695 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1696 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1697 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1698 const char* uri, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1699 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1700 uint32_t bodySize) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1701 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1702 _OrthancPluginRestApiPostPut params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1703 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1704 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1705 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1706 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1707 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1708 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1709 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1710 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1711 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1712 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1713 * @brief Make a DELETE call to the built-in Orthanc REST API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1714 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1715 * Make a DELETE call to the built-in Orthanc REST API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1716 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1717 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1718 * @param uri The URI to delete in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1719 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1720 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1721 * @see OrthancPluginRestApiDeleteAfterPlugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1722 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1723 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1724 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1725 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1726 const char* uri) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1727 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1728 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1729 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1730 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1731 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1732 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1733 * @brief Make a DELETE call to the REST API, as tainted by the plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1734 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1735 * Make a DELETE call to the Orthanc REST API, after all the plugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1736 * are applied. In other words, if some plugin overrides or adds the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1737 * called URI to the built-in Orthanc REST API, this call will |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1738 * return the result provided by this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1739 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1740 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1741 * @param uri The URI to delete in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1742 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1743 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1744 * @see OrthancPluginRestApiDelete |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1745 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1746 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1747 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1748 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1749 const char* uri) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1750 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1751 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1752 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1753 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1754 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1755 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1756 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1757 * @brief Make a PUT call to the built-in Orthanc REST API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1758 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1759 * Make a PUT call to the built-in Orthanc REST API. The result to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1760 * the query is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1761 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1762 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1763 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1764 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1765 * @param body The body of the PUT request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1766 * @param bodySize The size of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1767 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1768 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1769 * @see OrthancPluginRestApiPutAfterPlugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1770 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1771 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1772 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1773 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1774 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1775 const char* uri, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1776 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1777 uint32_t bodySize) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1778 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1779 _OrthancPluginRestApiPostPut params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1780 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1781 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1782 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1783 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1784 return context->InvokeService(context, _OrthancPluginService_RestApiPut, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1785 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1786 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1787 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1788 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1789 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1790 * @brief Make a PUT call to the REST API, as tainted by the plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1791 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1792 * Make a PUT call to the Orthanc REST API, after all the plugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1793 * are applied. In other words, if some plugin overrides or adds the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1794 * called URI to the built-in Orthanc REST API, this call will |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1795 * return the result provided by this plugin. The result to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1796 * query is stored into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1797 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1798 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1799 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1800 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1801 * @param body The body of the PUT request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1802 * @param bodySize The size of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1803 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1804 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1805 * @see OrthancPluginRestApiPut |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1806 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1807 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1808 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1809 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1810 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1811 const char* uri, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1812 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1813 uint32_t bodySize) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1814 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1815 _OrthancPluginRestApiPostPut params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1816 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1817 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1818 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1819 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1820 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1821 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1822 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1823 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1824 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1825 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1826 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1827 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1828 const char* argument; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1829 } _OrthancPluginOutputPlusArgument; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1830 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1831 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1832 * @brief Redirect a REST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1833 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1834 * This function answers to a REST request by redirecting the user |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1835 * to another URI using HTTP status 301. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1836 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1837 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1838 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1839 * @param redirection Where to redirect. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1840 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1841 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1842 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1843 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1844 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1845 const char* redirection) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1846 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1847 _OrthancPluginOutputPlusArgument params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1848 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1849 params.argument = redirection; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1850 context->InvokeService(context, _OrthancPluginService_Redirect, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1851 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1852 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1853 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1854 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1855 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1856 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1857 char** result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1858 const char* argument; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1859 } _OrthancPluginRetrieveDynamicString; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1860 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1861 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1862 * @brief Look for a patient. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1863 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1864 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1865 * This function uses the database index to run as fast as possible (it does not loop |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1866 * over all the stored patients). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1867 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1868 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1869 * @param patientID The Patient ID of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1870 * @return The NULL value if the patient is non-existent, or a string containing the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1871 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1872 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1873 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1874 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1875 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1876 const char* patientID) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1877 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1878 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1879 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1880 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1881 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1882 params.argument = patientID; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1883 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1884 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1885 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1886 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1887 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1888 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1889 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1890 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1891 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1892 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1893 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1894 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1895 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1896 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1897 * @brief Look for a study. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1898 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1899 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1900 * This function uses the database index to run as fast as possible (it does not loop |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1901 * over all the stored studies). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1902 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1903 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1904 * @param studyUID The Study Instance UID of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1905 * @return The NULL value if the study is non-existent, or a string containing the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1906 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1907 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1908 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1909 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1910 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1911 const char* studyUID) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1912 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1913 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1914 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1915 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1916 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1917 params.argument = studyUID; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1918 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1919 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1920 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1921 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1922 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1923 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1924 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1925 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1926 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1927 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1928 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1929 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1930 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1931 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1932 * @brief Look for a study, using the accession number. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1933 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1934 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1935 * This function uses the database index to run as fast as possible (it does not loop |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1936 * over all the stored studies). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1937 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1938 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1939 * @param accessionNumber The Accession Number of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1940 * @return The NULL value if the study is non-existent, or a string containing the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1941 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1942 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1943 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1944 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1945 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1946 const char* accessionNumber) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1947 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1948 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1949 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1950 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1951 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1952 params.argument = accessionNumber; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1953 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1954 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1955 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1956 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1957 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1958 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1959 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1960 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1961 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1962 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1963 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1964 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1965 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1966 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1967 * @brief Look for a series. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1968 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1969 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1970 * This function uses the database index to run as fast as possible (it does not loop |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1971 * over all the stored series). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1972 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1973 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1974 * @param seriesUID The Series Instance UID of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1975 * @return The NULL value if the series is non-existent, or a string containing the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1976 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1977 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1978 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1979 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1980 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1981 const char* seriesUID) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1982 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1983 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1984 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1985 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1986 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1987 params.argument = seriesUID; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1988 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1989 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1990 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1991 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1992 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1993 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1994 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1995 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1996 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1997 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1998 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1999 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2000 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2001 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2002 * @brief Look for an instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2003 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2004 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2005 * This function uses the database index to run as fast as possible (it does not loop |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2006 * over all the stored instances). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2007 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2008 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2009 * @param sopInstanceUID The SOP Instance UID of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2010 * @return The NULL value if the instance is non-existent, or a string containing the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2011 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2012 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2013 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2014 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2015 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2016 const char* sopInstanceUID) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2017 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2018 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2019 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2020 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2021 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2022 params.argument = sopInstanceUID; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2023 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2024 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2025 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2026 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2027 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2028 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2029 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2030 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2031 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2032 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2033 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2034 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2035 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2036 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2037 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2038 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2039 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2040 uint16_t status; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2041 } _OrthancPluginSendHttpStatusCode; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2042 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2043 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2044 * @brief Send a HTTP status code. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2045 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2046 * This function answers to a REST request by sending a HTTP status |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2047 * code (such as "400 - Bad Request"). Note that: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2048 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2049 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2050 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2051 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2052 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2053 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2054 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2055 * @param status The HTTP status code to be sent. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2056 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2057 * @see OrthancPluginSendHttpStatus() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2058 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2059 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2060 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2061 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2062 uint16_t status) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2063 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2064 _OrthancPluginSendHttpStatusCode params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2065 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2066 params.status = status; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2067 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2068 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2069 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2070 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2071 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2072 * @brief Signal that a REST request is not authorized. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2073 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2074 * This function answers to a REST request by signaling that it is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2075 * not authorized. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2076 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2077 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2078 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2079 * @param realm The realm for the authorization process. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2080 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2081 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2082 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2083 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2084 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2085 const char* realm) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2086 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2087 _OrthancPluginOutputPlusArgument params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2088 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2089 params.argument = realm; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2090 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2091 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2092 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2093 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2094 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2095 * @brief Signal that this URI does not support this HTTP method. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2096 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2097 * This function answers to a REST request by signaling that the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2098 * queried URI does not support this method. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2099 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2100 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2101 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2102 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2103 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2104 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2105 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2106 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2107 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2108 const char* allowedMethods) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2109 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2110 _OrthancPluginOutputPlusArgument params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2111 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2112 params.argument = allowedMethods; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2113 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2114 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2115 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2116 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2117 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2118 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2119 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2120 const char* key; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2121 const char* value; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2122 } _OrthancPluginSetHttpHeader; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2123 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2124 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2125 * @brief Set a cookie. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2126 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2127 * This function sets a cookie in the HTTP client. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2128 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2129 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2130 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2131 * @param cookie The cookie to be set. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2132 * @param value The value of the cookie. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2133 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2134 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2135 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2136 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2137 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2138 const char* cookie, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2139 const char* value) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2140 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2141 _OrthancPluginSetHttpHeader params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2142 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2143 params.key = cookie; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2144 params.value = value; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2145 context->InvokeService(context, _OrthancPluginService_SetCookie, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2146 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2147 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2148 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2149 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2150 * @brief Set some HTTP header. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2151 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2152 * This function sets a HTTP header in the HTTP answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2153 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2154 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2155 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2156 * @param key The HTTP header to be set. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2157 * @param value The value of the HTTP header. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2158 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2159 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2160 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2161 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2162 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2163 const char* key, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2164 const char* value) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2165 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2166 _OrthancPluginSetHttpHeader params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2167 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2168 params.key = key; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2169 params.value = value; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2170 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2171 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2172 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2173 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2174 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2175 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2176 char** resultStringToFree; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2177 const char** resultString; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2178 int64_t* resultInt64; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2179 const char* key; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2180 OrthancPluginDicomInstance* instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2181 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2182 } _OrthancPluginAccessDicomInstance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2183 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2184 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2185 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2186 * @brief Get the AET of a DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2187 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2188 * This function returns the Application Entity Title (AET) of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2189 * DICOM modality from which a DICOM instance originates. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2190 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2191 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2192 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2193 * @return The AET if success, NULL if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2194 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2195 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2196 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2197 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2198 OrthancPluginDicomInstance* instance) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2199 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2200 const char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2201 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2202 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2203 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2204 params.resultString = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2205 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2206 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2207 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2208 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2209 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2210 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2211 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2212 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2213 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2214 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2215 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2216 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2217 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2218 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2219 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2220 * @brief Get the size of a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2221 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2222 * This function returns the number of bytes of the given DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2223 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2224 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2225 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2226 * @return The size of the file, -1 in case of error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2227 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2228 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2229 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2230 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2231 OrthancPluginDicomInstance* instance) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2232 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2233 int64_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2234 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2235 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2236 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2237 params.resultInt64 = &size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2238 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2239 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2240 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2241 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2242 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2243 return -1; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2244 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2245 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2246 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2247 return size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2248 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2249 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2250 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2251 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2252 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2253 * @brief Get the data of a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2254 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2255 * This function returns a pointer to the content of the given DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2256 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2257 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2258 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2259 * @return The pointer to the DICOM data, NULL in case of error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2260 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2261 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2262 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2263 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2264 OrthancPluginDicomInstance* instance) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2265 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2266 const char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2267 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2268 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2269 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2270 params.resultString = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2271 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2272 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2273 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2274 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2275 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2276 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2277 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2278 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2279 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2280 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2281 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2282 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2283 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2284 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2285 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2286 * @brief Get the DICOM tag hierarchy as a JSON file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2287 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2288 * This function returns a pointer to a newly created string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2289 * containing a JSON file. This JSON file encodes the tag hierarchy |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2290 * of the given DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2291 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2292 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2293 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2294 * @return The NULL value in case of error, or a string containing the JSON file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2295 * This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2296 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2297 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2298 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2299 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2300 OrthancPluginDicomInstance* instance) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2301 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2302 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2303 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2304 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2305 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2306 params.resultStringToFree = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2307 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2308 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2309 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2310 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2311 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2312 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2313 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2314 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2315 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2316 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2317 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2318 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2319 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2320 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2321 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2322 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2323 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2324 * This function returns a pointer to a newly created string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2325 * containing a JSON file. This JSON file encodes the tag hierarchy |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2326 * of the given DICOM instance. In contrast with |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2327 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2328 * its simplified version. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2329 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2330 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2331 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2332 * @return The NULL value in case of error, or a string containing the JSON file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2333 * This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2334 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2335 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2336 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2337 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2338 OrthancPluginDicomInstance* instance) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2339 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2340 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2341 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2342 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2343 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2344 params.resultStringToFree = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2345 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2346 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2347 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2348 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2349 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2350 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2351 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2352 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2353 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2354 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2355 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2356 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2357 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2358 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2359 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2360 * @brief Check whether a DICOM instance is associated with some metadata. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2361 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2362 * This function checks whether the DICOM instance of interest is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2363 * associated with some metadata. As of Orthanc 0.8.1, in the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2364 * callbacks registered by |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2365 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2366 * possibly available metadata are "ReceptionDate", "RemoteAET" and |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2367 * "IndexInSeries". |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2368 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2369 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2370 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2371 * @param metadata The metadata of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2372 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2373 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2374 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2375 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2376 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2377 OrthancPluginDicomInstance* instance, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2378 const char* metadata) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2379 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2380 int64_t result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2381 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2382 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2383 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2384 params.resultInt64 = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2385 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2386 params.key = metadata; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2387 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2388 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2389 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2390 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2391 return -1; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2392 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2393 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2394 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2395 return (result != 0); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2396 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2397 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2398 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2399 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2400 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2401 * @brief Get the value of some metadata associated with a given DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2402 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2403 * This functions returns the value of some metadata that is associated with the DICOM instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2404 * Before calling this function, the existence of the metadata must have been checked with |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2405 * ::OrthancPluginHasInstanceMetadata(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2406 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2407 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2408 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2409 * @param metadata The metadata of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2410 * @return The metadata value if success, NULL if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2411 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2412 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2413 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2414 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2415 OrthancPluginDicomInstance* instance, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2416 const char* metadata) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2417 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2418 const char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2419 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2420 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2421 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2422 params.resultString = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2423 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2424 params.key = metadata; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2425 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2426 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2427 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2428 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2429 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2430 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2431 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2432 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2433 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2434 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2435 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2436 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2437 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2438 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2439 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2440 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2441 OrthancPluginStorageCreate create; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2442 OrthancPluginStorageRead read; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2443 OrthancPluginStorageRemove remove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2444 OrthancPluginFree free; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2445 } _OrthancPluginRegisterStorageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2446 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2447 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2448 * @brief Register a custom storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2449 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2450 * This function registers a custom storage area, to replace the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2451 * built-in way Orthanc stores its files on the filesystem. This |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2452 * function must be called during the initialization of the plugin, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2453 * i.e. inside the OrthancPluginInitialize() public function. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2454 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2455 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2456 * @param create The callback function to store a file on the custom storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2457 * @param read The callback function to read a file from the custom storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2458 * @param remove The callback function to remove a file from the custom storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2459 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2460 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2461 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2462 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2463 OrthancPluginStorageCreate create, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2464 OrthancPluginStorageRead read, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2465 OrthancPluginStorageRemove remove) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2466 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2467 _OrthancPluginRegisterStorageArea params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2468 params.create = create; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2469 params.read = read; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2470 params.remove = remove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2471 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2472 #ifdef __cplusplus |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2473 params.free = ::free; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2474 #else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2475 params.free = free; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2476 #endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2477 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2478 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2479 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2480 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2481 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2482 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2483 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2484 * @brief Return the path to the Orthanc executable. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2485 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2486 * This function returns the path to the Orthanc executable. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2487 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2488 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2489 * @return NULL in the case of an error, or a newly allocated string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2490 * containing the path. This string must be freed by |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2491 * OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2492 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2493 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2494 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2495 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2496 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2497 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2498 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2499 params.argument = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2500 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2501 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2502 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2503 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2504 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2505 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2506 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2507 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2508 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2509 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2510 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2511 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2512 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2513 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2514 * @brief Return the directory containing the Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2515 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2516 * This function returns the path to the directory containing the Orthanc executable. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2517 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2518 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2519 * @return NULL in the case of an error, or a newly allocated string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2520 * containing the path. This string must be freed by |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2521 * OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2522 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2523 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2524 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2525 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2526 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2527 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2528 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2529 params.argument = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2530 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2531 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2532 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2533 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2534 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2535 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2536 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2537 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2538 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2539 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2540 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2541 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2542 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2543 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2544 * @brief Return the path to the configuration file(s). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2545 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2546 * This function returns the path to the configuration file(s) that |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2547 * was specified when starting Orthanc. Since version 0.9.1, this |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2548 * path can refer to a folder that stores a set of configuration |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2549 * files. This function is deprecated in favor of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2550 * OrthancPluginGetConfiguration(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2551 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2552 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2553 * @return NULL in the case of an error, or a newly allocated string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2554 * containing the path. This string must be freed by |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2555 * OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2556 * @see OrthancPluginGetConfiguration() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2557 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2558 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2559 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2560 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2561 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2562 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2563 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2564 params.argument = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2565 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2566 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2567 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2568 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2569 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2570 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2571 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2572 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2573 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2574 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2575 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2576 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2577 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2578 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2579 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2580 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2581 OrthancPluginOnChangeCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2582 } _OrthancPluginOnChangeCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2583 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2584 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2585 * @brief Register a callback to monitor changes. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2586 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2587 * This function registers a callback function that is called |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2588 * whenever a change happens to some DICOM resource. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2589 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2590 * @warning If your change callback has to call the REST API of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2591 * Orthanc, you should make these calls in a separate thread (with |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2592 * the events passing through a message queue). Otherwise, this |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2593 * could result in deadlocks in the presence of other plugins or Lua |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2594 * scripts. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2595 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2596 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2597 * @param callback The callback function. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2598 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2599 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2600 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2601 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2602 OrthancPluginOnChangeCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2603 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2604 _OrthancPluginOnChangeCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2605 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2606 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2607 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2608 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2609 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2610 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2611 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2612 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2613 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2614 const char* plugin; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2615 _OrthancPluginProperty property; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2616 const char* value; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2617 } _OrthancPluginSetPluginProperty; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2618 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2619 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2620 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2621 * @brief Set the URI where the plugin provides its Web interface. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2622 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2623 * For plugins that come with a Web interface, this function |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2624 * declares the entry path where to find this interface. This |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2625 * information is notably used in the "Plugins" page of Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2626 * Explorer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2627 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2628 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2629 * @param uri The root URI for this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2630 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2631 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2632 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2633 const char* uri) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2634 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2635 _OrthancPluginSetPluginProperty params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2636 params.plugin = OrthancPluginGetName(); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2637 params.property = _OrthancPluginProperty_RootUri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2638 params.value = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2639 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2640 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2641 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2642 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2643 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2644 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2645 * @brief Set a description for this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2646 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2647 * Set a description for this plugin. It is displayed in the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2648 * "Plugins" page of Orthanc Explorer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2649 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2650 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2651 * @param description The description. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2652 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2653 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2654 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2655 const char* description) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2656 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2657 _OrthancPluginSetPluginProperty params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2658 params.plugin = OrthancPluginGetName(); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2659 params.property = _OrthancPluginProperty_Description; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2660 params.value = description; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2661 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2662 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2663 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2664 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2665 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2666 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2667 * @brief Extend the JavaScript code of Orthanc Explorer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2668 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2669 * Add JavaScript code to customize the default behavior of Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2670 * Explorer. This can for instance be used to add new buttons. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2671 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2672 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2673 * @param javascript The custom JavaScript code. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2674 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2675 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2676 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2677 const char* javascript) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2678 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2679 _OrthancPluginSetPluginProperty params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2680 params.plugin = OrthancPluginGetName(); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2681 params.property = _OrthancPluginProperty_OrthancExplorer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2682 params.value = javascript; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2683 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2684 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2685 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2686 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2687 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2688 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2689 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2690 char** result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2691 int32_t property; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2692 const char* value; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2693 } _OrthancPluginGlobalProperty; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2694 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2695 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2696 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2697 * @brief Get the value of a global property. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2698 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2699 * Get the value of a global property that is stored in the Orthanc database. Global |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2700 * properties whose index is below 1024 are reserved by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2701 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2702 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2703 * @param property The global property of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2704 * @param defaultValue The value to return, if the global property is unset. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2705 * @return The value of the global property, or NULL in the case of an error. This |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2706 * string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2707 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2708 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2709 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2710 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2711 int32_t property, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2712 const char* defaultValue) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2713 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2714 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2715 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2716 _OrthancPluginGlobalProperty params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2717 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2718 params.property = property; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2719 params.value = defaultValue; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2720 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2721 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2722 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2723 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2724 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2725 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2726 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2727 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2728 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2729 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2730 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2731 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2732 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2733 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2734 * @brief Set the value of a global property. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2735 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2736 * Set the value of a global property into the Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2737 * database. Setting a global property can be used by plugins to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2738 * save their internal parameters. Plugins are only allowed to set |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2739 * properties whose index are above or equal to 1024 (properties |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2740 * below 1024 are read-only and reserved by Orthanc). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2741 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2742 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2743 * @param property The global property of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2744 * @param value The value to be set in the global property. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2745 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2746 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2747 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2748 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2749 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2750 int32_t property, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2751 const char* value) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2752 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2753 _OrthancPluginGlobalProperty params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2754 params.result = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2755 params.property = property; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2756 params.value = value; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2757 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2758 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2759 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2760 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2761 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2762 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2763 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2764 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2765 int32_t *resultInt32; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2766 uint32_t *resultUint32; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2767 int64_t *resultInt64; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2768 uint64_t *resultUint64; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2769 } _OrthancPluginReturnSingleValue; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2770 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2771 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2772 * @brief Get the number of command-line arguments. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2773 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2774 * Retrieve the number of command-line arguments that were used to launch Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2775 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2776 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2777 * @return The number of arguments. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2778 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2779 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2780 OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2781 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2782 uint32_t count = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2783 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2784 _OrthancPluginReturnSingleValue params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2785 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2786 params.resultUint32 = &count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2787 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2788 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2789 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2790 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2791 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2792 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2793 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2794 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2795 return count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2796 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2797 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2798 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2799 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2800 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2801 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2802 * @brief Get the value of a command-line argument. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2803 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2804 * Get the value of one of the command-line arguments that were used |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2805 * to launch Orthanc. The number of available arguments can be |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2806 * retrieved by OrthancPluginGetCommandLineArgumentsCount(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2807 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2808 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2809 * @param argument The index of the argument. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2810 * @return The value of the argument, or NULL in the case of an error. This |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2811 * string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2812 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2813 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2814 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2815 uint32_t argument) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2816 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2817 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2818 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2819 _OrthancPluginGlobalProperty params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2820 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2821 params.property = (int32_t) argument; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2822 params.value = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2823 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2824 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2825 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2826 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2827 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2828 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2829 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2830 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2831 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2832 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2833 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2834 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2835 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2836 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2837 * @brief Get the expected version of the database schema. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2838 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2839 * Retrieve the expected version of the database schema. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2840 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2841 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2842 * @return The version. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2843 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2844 * @deprecated Please instead use IDatabaseBackend::UpgradeDatabase() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2845 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2846 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2847 OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2848 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2849 uint32_t count = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2850 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2851 _OrthancPluginReturnSingleValue params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2852 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2853 params.resultUint32 = &count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2854 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2855 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2856 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2857 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2858 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2859 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2860 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2861 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2862 return count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2863 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2864 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2865 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2866 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2867 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2868 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2869 * @brief Return the content of the configuration file(s). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2870 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2871 * This function returns the content of the configuration that is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2872 * used by Orthanc, formatted as a JSON string. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2873 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2874 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2875 * @return NULL in the case of an error, or a newly allocated string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2876 * containing the configuration. This string must be freed by |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2877 * OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2878 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2879 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2880 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2881 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2882 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2883 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2884 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2885 params.argument = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2886 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2887 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2888 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2889 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2890 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2891 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2892 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2893 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2894 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2895 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2896 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2897 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2898 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2899 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2900 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2901 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2902 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2903 const char* subType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2904 const char* contentType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2905 } _OrthancPluginStartMultipartAnswer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2906 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2907 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2908 * @brief Start an HTTP multipart answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2909 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2910 * Initiates a HTTP multipart answer, as the result of a REST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2911 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2912 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2913 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2914 * @param subType The sub-type of the multipart answer ("mixed" or "related"). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2915 * @param contentType The MIME type of the items in the multipart answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2916 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2917 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2918 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2919 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2920 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2921 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2922 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2923 const char* subType, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2924 const char* contentType) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2925 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2926 _OrthancPluginStartMultipartAnswer params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2927 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2928 params.subType = subType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2929 params.contentType = contentType; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2930 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2931 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2932 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2933 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2934 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2935 * @brief Send an item as a part of some HTTP multipart answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2936 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2937 * This function sends an item as a part of some HTTP multipart |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2938 * answer that was initiated by OrthancPluginStartMultipartAnswer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2939 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2940 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2941 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2942 * @param answer Pointer to the memory buffer containing the item. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2943 * @param answerSize Number of bytes of the item. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2944 * @return 0 if success, or the error code if failure (this notably happens |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2945 * if the connection is closed by the client). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2946 * @see OrthancPluginSendMultipartItem2() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2947 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2948 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2949 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2950 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2951 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2952 const char* answer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2953 uint32_t answerSize) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2954 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2955 _OrthancPluginAnswerBuffer params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2956 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2957 params.answer = answer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2958 params.answerSize = answerSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2959 params.mimeType = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2960 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2961 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2962 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2963 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2964 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2965 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2966 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2967 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2968 const void* source; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2969 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2970 OrthancPluginCompressionType compression; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2971 uint8_t uncompress; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2972 } _OrthancPluginBufferCompression; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2973 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2974 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2975 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2976 * @brief Compress or decompress a buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2977 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2978 * This function compresses or decompresses a buffer, using the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2979 * version of the zlib library that is used by the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2980 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2981 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2982 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2983 * @param source The source buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2984 * @param size The size in bytes of the source buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2985 * @param compression The compression algorithm. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2986 * @param uncompress If set to "0", the buffer must be compressed. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2987 * If set to "1", the buffer must be uncompressed. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2988 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2989 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2990 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2991 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2992 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2993 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2994 const void* source, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2995 uint32_t size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2996 OrthancPluginCompressionType compression, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2997 uint8_t uncompress) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2998 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2999 _OrthancPluginBufferCompression params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3000 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3001 params.source = source; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3002 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3003 params.compression = compression; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3004 params.uncompress = uncompress; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3005 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3006 return context->InvokeService(context, _OrthancPluginService_BufferCompression, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3007 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3008 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3009 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3010 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3011 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3012 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3013 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3014 const char* path; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3015 } _OrthancPluginReadFile; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3016 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3017 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3018 * @brief Read a file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3019 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3020 * Read the content of a file on the filesystem, and returns it into |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3021 * a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3022 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3023 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3024 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3025 * @param path The path of the file to be read. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3026 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3027 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3028 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3029 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3030 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3031 const char* path) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3032 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3033 _OrthancPluginReadFile params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3034 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3035 params.path = path; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3036 return context->InvokeService(context, _OrthancPluginService_ReadFile, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3037 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3038 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3039 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3040 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3041 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3042 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3043 const char* path; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3044 const void* data; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3045 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3046 } _OrthancPluginWriteFile; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3047 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3048 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3049 * @brief Write a file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3050 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3051 * Write the content of a memory buffer to the filesystem. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3052 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3053 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3054 * @param path The path of the file to be written. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3055 * @param data The content of the memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3056 * @param size The size of the memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3057 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3058 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3059 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3060 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3061 const char* path, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3062 const void* data, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3063 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3064 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3065 _OrthancPluginWriteFile params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3066 params.path = path; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3067 params.data = data; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3068 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3069 return context->InvokeService(context, _OrthancPluginService_WriteFile, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3070 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3071 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3072 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3073 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3074 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3075 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3076 const char** target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3077 OrthancPluginErrorCode error; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3078 } _OrthancPluginGetErrorDescription; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3079 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3080 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3081 * @brief Get the description of a given error code. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3082 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3083 * This function returns the description of a given error code. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3084 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3085 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3086 * @param error The error code of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3087 * @return The error description. This is a statically-allocated |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3088 * string, do not free it. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3089 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3090 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3091 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3092 OrthancPluginErrorCode error) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3093 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3094 const char* result = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3095 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3096 _OrthancPluginGetErrorDescription params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3097 params.target = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3098 params.error = error; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3099 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3100 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, ¶ms) != OrthancPluginErrorCode_Success || |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3101 result == NULL) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3102 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3103 return "Unknown error code"; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3104 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3105 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3106 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3107 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3108 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3109 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3110 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3111 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3112 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3113 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3114 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3115 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3116 uint16_t status; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3117 const char* body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3118 uint32_t bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3119 } _OrthancPluginSendHttpStatus; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3120 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3121 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3122 * @brief Send a HTTP status, with a custom body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3123 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3124 * This function answers to a HTTP request by sending a HTTP status |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3125 * code (such as "400 - Bad Request"), together with a body |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3126 * describing the error. The body will only be returned if the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3127 * configuration option "HttpDescribeErrors" of Orthanc is set to "true". |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3128 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3129 * Note that: |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3130 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3131 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3132 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3133 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3134 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3135 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3136 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3137 * @param status The HTTP status code to be sent. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3138 * @param body The body of the answer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3139 * @param bodySize The size of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3140 * @see OrthancPluginSendHttpStatusCode() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3141 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3142 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3143 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3144 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3145 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3146 uint16_t status, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3147 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3148 uint32_t bodySize) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3149 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3150 _OrthancPluginSendHttpStatus params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3151 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3152 params.status = status; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3153 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3154 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3155 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3156 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3157 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3158 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3159 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3160 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3161 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3162 const OrthancPluginImage* image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3163 uint32_t* resultUint32; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3164 OrthancPluginPixelFormat* resultPixelFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3165 void** resultBuffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3166 } _OrthancPluginGetImageInfo; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3167 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3168 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3169 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3170 * @brief Return the pixel format of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3171 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3172 * This function returns the type of memory layout for the pixels of the given image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3173 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3174 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3175 * @param image The image of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3176 * @return The pixel format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3177 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3178 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3179 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3180 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3181 const OrthancPluginImage* image) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3182 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3183 OrthancPluginPixelFormat target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3184 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3185 _OrthancPluginGetImageInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3186 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3187 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3188 params.resultPixelFormat = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3189 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3190 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3191 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3192 return OrthancPluginPixelFormat_Unknown; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3193 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3194 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3195 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3196 return (OrthancPluginPixelFormat) target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3197 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3198 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3199 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3200 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3201 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3202 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3203 * @brief Return the width of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3204 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3205 * This function returns the width of the given image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3206 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3207 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3208 * @param image The image of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3209 * @return The width. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3210 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3211 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3212 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3213 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3214 const OrthancPluginImage* image) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3215 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3216 uint32_t width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3217 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3218 _OrthancPluginGetImageInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3219 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3220 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3221 params.resultUint32 = &width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3222 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3223 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3224 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3225 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3226 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3227 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3228 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3229 return width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3230 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3231 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3232 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3233 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3234 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3235 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3236 * @brief Return the height of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3237 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3238 * This function returns the height of the given image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3239 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3240 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3241 * @param image The image of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3242 * @return The height. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3243 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3244 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3245 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3246 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3247 const OrthancPluginImage* image) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3248 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3249 uint32_t height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3250 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3251 _OrthancPluginGetImageInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3252 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3253 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3254 params.resultUint32 = &height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3255 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3256 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3257 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3258 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3259 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3260 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3261 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3262 return height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3263 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3264 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3265 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3266 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3267 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3268 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3269 * @brief Return the pitch of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3270 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3271 * This function returns the pitch of the given image. The pitch is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3272 * defined as the number of bytes between 2 successive lines of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3273 * image in the memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3274 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3275 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3276 * @param image The image of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3277 * @return The pitch. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3278 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3279 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3280 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3281 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3282 const OrthancPluginImage* image) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3283 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3284 uint32_t pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3285 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3286 _OrthancPluginGetImageInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3287 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3288 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3289 params.resultUint32 = &pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3290 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3291 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3292 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3293 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3294 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3295 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3296 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3297 return pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3298 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3299 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3300 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3301 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3302 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3303 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3304 * @brief Return a pointer to the content of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3305 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3306 * This function returns a pointer to the memory buffer that |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3307 * contains the pixels of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3308 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3309 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3310 * @param image The image of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3311 * @return The pointer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3312 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3313 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3314 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3315 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3316 const OrthancPluginImage* image) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3317 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3318 void* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3319 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3320 _OrthancPluginGetImageInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3321 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3322 params.resultBuffer = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3323 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3324 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3325 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3326 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3327 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3328 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3329 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3330 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3331 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3332 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3333 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3334 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3335 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3336 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3337 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3338 OrthancPluginImage** target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3339 const void* data; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3340 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3341 OrthancPluginImageFormat format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3342 } _OrthancPluginUncompressImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3343 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3344 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3345 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3346 * @brief Decode a compressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3347 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3348 * This function decodes a compressed image from a memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3349 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3350 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3351 * @param data Pointer to a memory buffer containing the compressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3352 * @param size Size of the memory buffer containing the compressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3353 * @param format The file format of the compressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3354 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3355 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3356 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3357 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3358 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3359 const void* data, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3360 uint32_t size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3361 OrthancPluginImageFormat format) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3362 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3363 OrthancPluginImage* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3364 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3365 _OrthancPluginUncompressImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3366 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3367 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3368 params.data = data; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3369 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3370 params.format = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3371 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3372 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3373 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3374 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3375 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3376 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3377 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3378 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3379 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3380 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3381 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3382 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3383 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3384 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3385 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3386 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3387 OrthancPluginImage* image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3388 } _OrthancPluginFreeImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3389 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3390 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3391 * @brief Free an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3392 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3393 * This function frees an image that was decoded with OrthancPluginUncompressImage(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3394 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3395 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3396 * @param image The image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3397 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3398 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3399 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3400 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3401 OrthancPluginImage* image) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3402 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3403 _OrthancPluginFreeImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3404 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3405 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3406 context->InvokeService(context, _OrthancPluginService_FreeImage, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3407 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3408 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3409 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3410 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3411 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3412 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3413 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3414 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3415 OrthancPluginImageFormat imageFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3416 OrthancPluginPixelFormat pixelFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3417 uint32_t width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3418 uint32_t height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3419 uint32_t pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3420 const void* buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3421 uint8_t quality; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3422 } _OrthancPluginCompressImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3423 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3424 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3425 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3426 * @brief Encode a PNG image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3427 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3428 * This function compresses the given memory buffer containing an |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3429 * image using the PNG specification, and stores the result of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3430 * compression into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3431 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3432 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3433 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3434 * @param format The memory layout of the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3435 * @param width The width of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3436 * @param height The height of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3437 * @param pitch The pitch of the image (i.e. the number of bytes |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3438 * between 2 successive lines of the image in the memory buffer). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3439 * @param buffer The memory buffer containing the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3440 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3441 * @see OrthancPluginCompressAndAnswerPngImage() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3442 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3443 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3444 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3445 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3446 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3447 OrthancPluginPixelFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3448 uint32_t width, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3449 uint32_t height, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3450 uint32_t pitch, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3451 const void* buffer) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3452 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3453 _OrthancPluginCompressImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3454 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3455 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3456 params.imageFormat = OrthancPluginImageFormat_Png; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3457 params.pixelFormat = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3458 params.width = width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3459 params.height = height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3460 params.pitch = pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3461 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3462 params.quality = 0; /* Unused for PNG */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3463 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3464 return context->InvokeService(context, _OrthancPluginService_CompressImage, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3465 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3466 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3467 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3468 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3469 * @brief Encode a JPEG image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3470 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3471 * This function compresses the given memory buffer containing an |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3472 * image using the JPEG specification, and stores the result of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3473 * compression into a newly allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3474 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3475 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3476 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3477 * @param format The memory layout of the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3478 * @param width The width of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3479 * @param height The height of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3480 * @param pitch The pitch of the image (i.e. the number of bytes |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3481 * between 2 successive lines of the image in the memory buffer). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3482 * @param buffer The memory buffer containing the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3483 * @param quality The quality of the JPEG encoding, between 1 (worst |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3484 * quality, best compression) and 100 (best quality, worst |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3485 * compression). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3486 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3487 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3488 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3489 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3490 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3491 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3492 OrthancPluginPixelFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3493 uint32_t width, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3494 uint32_t height, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3495 uint32_t pitch, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3496 const void* buffer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3497 uint8_t quality) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3498 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3499 _OrthancPluginCompressImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3500 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3501 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3502 params.imageFormat = OrthancPluginImageFormat_Jpeg; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3503 params.pixelFormat = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3504 params.width = width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3505 params.height = height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3506 params.pitch = pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3507 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3508 params.quality = quality; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3509 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3510 return context->InvokeService(context, _OrthancPluginService_CompressImage, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3511 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3512 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3513 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3514 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3515 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3516 * @brief Answer to a REST request with a JPEG image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3517 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3518 * This function answers to a REST request with a JPEG image. The |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3519 * parameters of this function describe a memory buffer that |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3520 * contains an uncompressed image. The image will be automatically compressed |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3521 * as a JPEG image by the core system of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3522 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3523 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3524 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3525 * @param format The memory layout of the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3526 * @param width The width of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3527 * @param height The height of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3528 * @param pitch The pitch of the image (i.e. the number of bytes |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3529 * between 2 successive lines of the image in the memory buffer). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3530 * @param buffer The memory buffer containing the uncompressed image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3531 * @param quality The quality of the JPEG encoding, between 1 (worst |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3532 * quality, best compression) and 100 (best quality, worst |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3533 * compression). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3534 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3535 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3536 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3537 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3538 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3539 OrthancPluginPixelFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3540 uint32_t width, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3541 uint32_t height, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3542 uint32_t pitch, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3543 const void* buffer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3544 uint8_t quality) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3545 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3546 _OrthancPluginCompressAndAnswerImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3547 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3548 params.imageFormat = OrthancPluginImageFormat_Jpeg; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3549 params.pixelFormat = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3550 params.width = width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3551 params.height = height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3552 params.pitch = pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3553 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3554 params.quality = quality; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3555 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3556 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3557 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3558 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3559 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3560 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3561 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3562 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3563 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3564 OrthancPluginHttpMethod method; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3565 const char* url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3566 const char* username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3567 const char* password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3568 const char* body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3569 uint32_t bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3570 } _OrthancPluginCallHttpClient; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3571 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3572 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3573 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3574 * @brief Issue a HTTP GET call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3575 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3576 * Make a HTTP GET call to the given URL. The result to the query is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3577 * stored into a newly allocated memory buffer. Favor |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3578 * OrthancPluginRestApiGet() if calling the built-in REST API of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3579 * Orthanc instance that hosts this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3580 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3581 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3582 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3583 * @param url The URL of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3584 * @param username The username (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3585 * @param password The password (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3586 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3587 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3588 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3589 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3590 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3591 const char* url, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3592 const char* username, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3593 const char* password) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3594 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3595 _OrthancPluginCallHttpClient params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3596 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3597 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3598 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3599 params.method = OrthancPluginHttpMethod_Get; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3600 params.url = url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3601 params.username = username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3602 params.password = password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3603 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3604 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3605 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3606 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3607 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3608 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3609 * @brief Issue a HTTP POST call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3610 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3611 * Make a HTTP POST call to the given URL. The result to the query |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3612 * is stored into a newly allocated memory buffer. Favor |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3613 * OrthancPluginRestApiPost() if calling the built-in REST API of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3614 * the Orthanc instance that hosts this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3615 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3616 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3617 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3618 * @param url The URL of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3619 * @param body The content of the body of the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3620 * @param bodySize The size of the body of the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3621 * @param username The username (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3622 * @param password The password (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3623 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3624 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3625 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3626 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3627 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3628 const char* url, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3629 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3630 uint32_t bodySize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3631 const char* username, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3632 const char* password) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3633 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3634 _OrthancPluginCallHttpClient params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3635 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3636 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3637 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3638 params.method = OrthancPluginHttpMethod_Post; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3639 params.url = url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3640 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3641 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3642 params.username = username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3643 params.password = password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3644 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3645 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3646 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3647 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3648 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3649 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3650 * @brief Issue a HTTP PUT call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3651 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3652 * Make a HTTP PUT call to the given URL. The result to the query is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3653 * stored into a newly allocated memory buffer. Favor |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3654 * OrthancPluginRestApiPut() if calling the built-in REST API of the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3655 * Orthanc instance that hosts this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3656 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3657 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3658 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3659 * @param url The URL of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3660 * @param body The content of the body of the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3661 * @param bodySize The size of the body of the request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3662 * @param username The username (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3663 * @param password The password (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3664 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3665 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3666 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3667 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3668 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3669 const char* url, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3670 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3671 uint32_t bodySize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3672 const char* username, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3673 const char* password) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3674 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3675 _OrthancPluginCallHttpClient params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3676 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3677 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3678 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3679 params.method = OrthancPluginHttpMethod_Put; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3680 params.url = url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3681 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3682 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3683 params.username = username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3684 params.password = password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3685 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3686 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3687 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3688 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3689 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3690 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3691 * @brief Issue a HTTP DELETE call. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3692 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3693 * Make a HTTP DELETE call to the given URL. Favor |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3694 * OrthancPluginRestApiDelete() if calling the built-in REST API of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3695 * the Orthanc instance that hosts this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3696 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3697 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3698 * @param url The URL of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3699 * @param username The username (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3700 * @param password The password (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3701 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3702 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3703 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3704 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3705 const char* url, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3706 const char* username, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3707 const char* password) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3708 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3709 _OrthancPluginCallHttpClient params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3710 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3711 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3712 params.method = OrthancPluginHttpMethod_Delete; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3713 params.url = url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3714 params.username = username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3715 params.password = password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3716 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3717 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3718 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3719 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3720 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3721 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3722 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3723 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3724 OrthancPluginImage** target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3725 const OrthancPluginImage* source; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3726 OrthancPluginPixelFormat targetFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3727 } _OrthancPluginConvertPixelFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3728 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3729 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3730 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3731 * @brief Change the pixel format of an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3732 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3733 * This function creates a new image, changing the memory layout of the pixels. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3734 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3735 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3736 * @param source The source image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3737 * @param targetFormat The target pixel format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3738 * @return The resulting image. It must be freed with OrthancPluginFreeImage(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3739 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3740 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3741 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3742 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3743 const OrthancPluginImage* source, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3744 OrthancPluginPixelFormat targetFormat) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3745 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3746 OrthancPluginImage* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3747 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3748 _OrthancPluginConvertPixelFormat params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3749 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3750 params.source = source; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3751 params.targetFormat = targetFormat; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3752 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3753 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3754 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3755 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3756 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3757 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3758 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3759 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3760 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3761 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3762 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3763 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3764 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3765 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3766 * @brief Return the number of available fonts. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3767 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3768 * This function returns the number of fonts that are built in the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3769 * Orthanc core. These fonts can be used to draw texts on images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3770 * through OrthancPluginDrawText(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3771 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3772 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3773 * @return The number of fonts. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3774 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3775 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3776 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3777 OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3778 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3779 uint32_t count = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3780 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3781 _OrthancPluginReturnSingleValue params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3782 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3783 params.resultUint32 = &count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3784 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3785 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3786 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3787 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3788 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3789 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3790 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3791 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3792 return count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3793 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3794 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3795 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3796 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3797 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3798 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3799 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3800 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3801 uint32_t fontIndex; /* in */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3802 const char** name; /* out */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3803 uint32_t* size; /* out */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3804 } _OrthancPluginGetFontInfo; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3805 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3806 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3807 * @brief Return the name of a font. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3808 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3809 * This function returns the name of a font that is built in the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3810 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3811 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3812 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3813 * @return The font name. This is a statically-allocated string, do not free it. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3814 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3815 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3816 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3817 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3818 uint32_t fontIndex) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3819 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3820 const char* result = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3821 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3822 _OrthancPluginGetFontInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3823 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3824 params.name = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3825 params.fontIndex = fontIndex; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3826 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3827 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3828 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3829 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3830 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3831 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3832 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3833 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3834 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3835 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3836 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3837 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3838 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3839 * @brief Return the size of a font. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3840 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3841 * This function returns the size of a font that is built in the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3842 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3843 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3844 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3845 * @return The font size. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3846 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3847 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3848 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3849 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3850 uint32_t fontIndex) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3851 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3852 uint32_t result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3853 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3854 _OrthancPluginGetFontInfo params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3855 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3856 params.size = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3857 params.fontIndex = fontIndex; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3858 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3859 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3860 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3861 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3862 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3863 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3864 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3865 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3866 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3867 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3868 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3869 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3870 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3871 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3872 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3873 OrthancPluginImage* image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3874 uint32_t fontIndex; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3875 const char* utf8Text; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3876 int32_t x; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3877 int32_t y; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3878 uint8_t r; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3879 uint8_t g; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3880 uint8_t b; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3881 } _OrthancPluginDrawText; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3882 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3883 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3884 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3885 * @brief Draw text on an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3886 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3887 * This function draws some text on some image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3888 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3889 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3890 * @param image The image upon which to draw the text. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3891 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3892 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3893 * @param x The X position of the text over the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3894 * @param y The Y position of the text over the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3895 * @param r The value of the red color channel of the text. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3896 * @param g The value of the green color channel of the text. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3897 * @param b The value of the blue color channel of the text. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3898 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3899 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3900 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3901 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3902 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3903 OrthancPluginImage* image, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3904 uint32_t fontIndex, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3905 const char* utf8Text, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3906 int32_t x, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3907 int32_t y, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3908 uint8_t r, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3909 uint8_t g, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3910 uint8_t b) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3911 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3912 _OrthancPluginDrawText params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3913 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3914 params.image = image; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3915 params.fontIndex = fontIndex; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3916 params.utf8Text = utf8Text; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3917 params.x = x; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3918 params.y = y; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3919 params.r = r; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3920 params.g = g; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3921 params.b = b; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3922 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3923 return context->InvokeService(context, _OrthancPluginService_DrawText, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3924 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3925 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3926 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3927 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3928 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3929 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3930 OrthancPluginStorageArea* storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3931 const char* uuid; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3932 const void* content; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3933 uint64_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3934 OrthancPluginContentType type; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3935 } _OrthancPluginStorageAreaCreate; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3936 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3937 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3938 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3939 * @brief Create a file inside the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3940 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3941 * This function creates a new file inside the storage area that is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3942 * currently used by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3943 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3944 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3945 * @param storageArea The storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3946 * @param uuid The identifier of the file to be created. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3947 * @param content The content to store in the newly created file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3948 * @param size The size of the content. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3949 * @param type The type of the file content. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3950 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3951 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3952 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3953 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3954 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3955 OrthancPluginStorageArea* storageArea, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3956 const char* uuid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3957 const void* content, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3958 uint64_t size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3959 OrthancPluginContentType type) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3960 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3961 _OrthancPluginStorageAreaCreate params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3962 params.storageArea = storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3963 params.uuid = uuid; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3964 params.content = content; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3965 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3966 params.type = type; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3967 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3968 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3969 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3970 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3971 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3972 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3973 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3974 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3975 OrthancPluginStorageArea* storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3976 const char* uuid; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3977 OrthancPluginContentType type; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3978 } _OrthancPluginStorageAreaRead; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3979 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3980 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3981 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3982 * @brief Read a file from the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3983 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3984 * This function reads the content of a given file from the storage |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3985 * area that is currently used by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3986 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3987 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3988 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3989 * @param storageArea The storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3990 * @param uuid The identifier of the file to be read. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3991 * @param type The type of the file content. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3992 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3993 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3994 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3995 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3996 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3997 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3998 OrthancPluginStorageArea* storageArea, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3999 const char* uuid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4000 OrthancPluginContentType type) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4001 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4002 _OrthancPluginStorageAreaRead params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4003 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4004 params.storageArea = storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4005 params.uuid = uuid; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4006 params.type = type; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4007 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4008 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4009 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4010 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4011 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4012 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4013 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4014 OrthancPluginStorageArea* storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4015 const char* uuid; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4016 OrthancPluginContentType type; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4017 } _OrthancPluginStorageAreaRemove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4018 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4019 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4020 * @brief Remove a file from the storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4021 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4022 * This function removes a given file from the storage area that is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4023 * currently used by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4024 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4025 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4026 * @param storageArea The storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4027 * @param uuid The identifier of the file to be removed. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4028 * @param type The type of the file content. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4029 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4030 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4031 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4032 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4033 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4034 OrthancPluginStorageArea* storageArea, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4035 const char* uuid, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4036 OrthancPluginContentType type) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4037 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4038 _OrthancPluginStorageAreaRemove params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4039 params.storageArea = storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4040 params.uuid = uuid; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4041 params.type = type; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4042 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4043 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4044 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4045 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4046 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4047 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4048 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4049 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4050 OrthancPluginErrorCode* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4051 int32_t code; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4052 uint16_t httpStatus; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4053 const char* message; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4054 } _OrthancPluginRegisterErrorCode; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4055 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4056 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4057 * @brief Declare a custom error code for this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4058 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4059 * This function declares a custom error code that can be generated |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4060 * by this plugin. This declaration is used to enrich the body of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4061 * the HTTP answer in the case of an error, and to set the proper |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4062 * HTTP status code. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4063 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4064 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4065 * @param code The error code that is internal to this plugin. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4066 * @param httpStatus The HTTP status corresponding to this error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4067 * @param message The description of the error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4068 * @return The error code that has been assigned inside the Orthanc core. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4069 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4070 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4071 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4072 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4073 int32_t code, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4074 uint16_t httpStatus, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4075 const char* message) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4076 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4077 OrthancPluginErrorCode target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4078 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4079 _OrthancPluginRegisterErrorCode params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4080 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4081 params.code = code; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4082 params.httpStatus = httpStatus; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4083 params.message = message; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4084 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4085 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, ¶ms) == OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4086 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4087 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4088 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4089 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4090 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4091 /* There was an error while assigned the error. Use a generic code. */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4092 return OrthancPluginErrorCode_Plugin; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4093 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4094 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4095 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4096 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4097 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4098 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4099 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4100 uint16_t group; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4101 uint16_t element; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4102 OrthancPluginValueRepresentation vr; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4103 const char* name; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4104 uint32_t minMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4105 uint32_t maxMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4106 } _OrthancPluginRegisterDictionaryTag; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4107 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4108 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4109 * @brief Register a new tag into the DICOM dictionary. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4110 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4111 * This function declares a new public tag in the dictionary of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4112 * DICOM tags that are known to Orthanc. This function should be |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4113 * used in the OrthancPluginInitialize() callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4114 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4115 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4116 * @param group The group of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4117 * @param element The element of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4118 * @param vr The value representation of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4119 * @param name The nickname of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4120 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4121 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4122 * an arbitrary multiplicity ("<tt>n</tt>"). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4123 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4124 * @see OrthancPluginRegisterPrivateDictionaryTag() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4125 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4126 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4127 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4128 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4129 uint16_t group, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4130 uint16_t element, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4131 OrthancPluginValueRepresentation vr, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4132 const char* name, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4133 uint32_t minMultiplicity, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4134 uint32_t maxMultiplicity) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4135 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4136 _OrthancPluginRegisterDictionaryTag params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4137 params.group = group; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4138 params.element = element; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4139 params.vr = vr; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4140 params.name = name; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4141 params.minMultiplicity = minMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4142 params.maxMultiplicity = maxMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4143 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4144 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4145 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4146 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4147 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4148 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4149 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4150 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4151 uint16_t group; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4152 uint16_t element; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4153 OrthancPluginValueRepresentation vr; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4154 const char* name; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4155 uint32_t minMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4156 uint32_t maxMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4157 const char* privateCreator; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4158 } _OrthancPluginRegisterPrivateDictionaryTag; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4159 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4160 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4161 * @brief Register a new private tag into the DICOM dictionary. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4162 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4163 * This function declares a new private tag in the dictionary of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4164 * DICOM tags that are known to Orthanc. This function should be |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4165 * used in the OrthancPluginInitialize() callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4166 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4167 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4168 * @param group The group of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4169 * @param element The element of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4170 * @param vr The value representation of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4171 * @param name The nickname of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4172 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4173 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4174 * an arbitrary multiplicity ("<tt>n</tt>"). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4175 * @param privateCreator The private creator of this private tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4176 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4177 * @see OrthancPluginRegisterDictionaryTag() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4178 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4179 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4180 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4181 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4182 uint16_t group, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4183 uint16_t element, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4184 OrthancPluginValueRepresentation vr, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4185 const char* name, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4186 uint32_t minMultiplicity, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4187 uint32_t maxMultiplicity, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4188 const char* privateCreator) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4189 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4190 _OrthancPluginRegisterPrivateDictionaryTag params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4191 params.group = group; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4192 params.element = element; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4193 params.vr = vr; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4194 params.name = name; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4195 params.minMultiplicity = minMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4196 params.maxMultiplicity = maxMultiplicity; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4197 params.privateCreator = privateCreator; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4198 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4199 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4200 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4201 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4202 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4203 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4204 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4205 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4206 OrthancPluginStorageArea* storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4207 OrthancPluginResourceType level; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4208 } _OrthancPluginReconstructMainDicomTags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4209 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4210 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4211 * @brief Reconstruct the main DICOM tags. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4212 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4213 * This function requests the Orthanc core to reconstruct the main |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4214 * DICOM tags of all the resources of the given type. This function |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4215 * can only be used as a part of the upgrade of a custom database |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4216 * back-end |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4217 * (cf. OrthancPlugins::IDatabaseBackend::UpgradeDatabase). A |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4218 * database transaction will be automatically setup. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4219 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4220 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4221 * @param storageArea The storage area. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4222 * @param level The type of the resources of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4223 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4224 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4225 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4226 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4227 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4228 OrthancPluginStorageArea* storageArea, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4229 OrthancPluginResourceType level) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4230 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4231 _OrthancPluginReconstructMainDicomTags params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4232 params.level = level; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4233 params.storageArea = storageArea; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4234 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4235 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4236 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4237 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4238 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4239 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4240 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4241 char** result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4242 const char* instanceId; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4243 const void* buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4244 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4245 OrthancPluginDicomToJsonFormat format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4246 OrthancPluginDicomToJsonFlags flags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4247 uint32_t maxStringLength; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4248 } _OrthancPluginDicomToJson; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4249 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4250 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4251 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4252 * @brief Format a DICOM memory buffer as a JSON string. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4253 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4254 * This function takes as input a memory buffer containing a DICOM |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4255 * file, and outputs a JSON string representing the tags of this |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4256 * DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4257 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4258 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4259 * @param buffer The memory buffer containing the DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4260 * @param size The size of the memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4261 * @param format The output format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4262 * @param flags Flags governing the output. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4263 * @param maxStringLength The maximum length of a field. Too long fields will |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4264 * be output as "null". The 0 value means no maximum length. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4265 * @return The NULL value if the case of an error, or the JSON |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4266 * string. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4267 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4268 * @see OrthancPluginDicomInstanceToJson |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4269 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4270 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4271 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4272 const void* buffer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4273 uint32_t size, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4274 OrthancPluginDicomToJsonFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4275 OrthancPluginDicomToJsonFlags flags, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4276 uint32_t maxStringLength) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4277 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4278 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4279 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4280 _OrthancPluginDicomToJson params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4281 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4282 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4283 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4284 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4285 params.format = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4286 params.flags = flags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4287 params.maxStringLength = maxStringLength; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4288 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4289 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4290 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4291 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4292 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4293 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4294 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4295 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4296 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4297 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4298 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4299 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4300 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4301 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4302 * @brief Format a DICOM instance as a JSON string. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4303 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4304 * This function formats a DICOM instance that is stored in Orthanc, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4305 * and outputs a JSON string representing the tags of this DICOM |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4306 * instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4307 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4308 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4309 * @param instanceId The Orthanc identifier of the instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4310 * @param format The output format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4311 * @param flags Flags governing the output. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4312 * @param maxStringLength The maximum length of a field. Too long fields will |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4313 * be output as "null". The 0 value means no maximum length. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4314 * @return The NULL value if the case of an error, or the JSON |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4315 * string. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4316 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4317 * @see OrthancPluginDicomInstanceToJson |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4318 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4319 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4320 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4321 const char* instanceId, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4322 OrthancPluginDicomToJsonFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4323 OrthancPluginDicomToJsonFlags flags, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4324 uint32_t maxStringLength) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4325 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4326 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4327 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4328 _OrthancPluginDicomToJson params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4329 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4330 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4331 params.instanceId = instanceId; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4332 params.format = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4333 params.flags = flags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4334 params.maxStringLength = maxStringLength; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4335 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4336 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4337 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4338 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4339 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4340 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4341 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4342 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4343 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4344 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4345 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4346 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4347 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4348 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4349 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4350 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4351 const char* uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4352 uint32_t headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4353 const char* const* headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4354 const char* const* headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4355 int32_t afterPlugins; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4356 } _OrthancPluginRestApiGet2; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4357 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4358 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4359 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4360 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4361 * Make a GET call to the Orthanc REST API with extended |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4362 * parameters. The result to the query is stored into a newly |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4363 * allocated memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4364 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4365 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4366 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4367 * @param uri The URI in the built-in Orthanc API. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4368 * @param headersCount The number of HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4369 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4370 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4371 * @param afterPlugins If 0, the built-in API of Orthanc is used. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4372 * If 1, the API is tainted by the plugins. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4373 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4374 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4375 * @ingroup Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4376 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4377 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4378 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4379 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4380 const char* uri, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4381 uint32_t headersCount, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4382 const char* const* headersKeys, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4383 const char* const* headersValues, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4384 int32_t afterPlugins) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4385 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4386 _OrthancPluginRestApiGet2 params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4387 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4388 params.uri = uri; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4389 params.headersCount = headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4390 params.headersKeys = headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4391 params.headersValues = headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4392 params.afterPlugins = afterPlugins; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4393 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4394 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4395 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4396 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4397 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4398 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4399 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4400 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4401 OrthancPluginWorklistCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4402 } _OrthancPluginWorklistCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4403 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4404 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4405 * @brief Register a callback to handle modality worklists requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4406 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4407 * This function registers a callback to handle C-Find SCP requests |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4408 * on modality worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4409 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4410 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4411 * @param callback The callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4412 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4413 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4414 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4415 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4416 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4417 OrthancPluginWorklistCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4418 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4419 _OrthancPluginWorklistCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4420 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4421 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4422 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4423 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4424 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4425 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4426 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4427 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4428 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4429 OrthancPluginWorklistAnswers* answers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4430 const OrthancPluginWorklistQuery* query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4431 const void* dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4432 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4433 } _OrthancPluginWorklistAnswersOperation; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4434 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4435 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4436 * @brief Add one answer to some modality worklist request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4437 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4438 * This function adds one worklist (encoded as a DICOM file) to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4439 * set of answers corresponding to some C-Find SCP request against |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4440 * modality worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4441 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4442 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4443 * @param answers The set of answers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4444 * @param query The worklist query, as received by the callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4445 * @param dicom The worklist to answer, encoded as a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4446 * @param size The size of the DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4447 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4448 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4449 * @see OrthancPluginCreateDicom() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4450 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4451 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4452 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4453 OrthancPluginWorklistAnswers* answers, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4454 const OrthancPluginWorklistQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4455 const void* dicom, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4456 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4457 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4458 _OrthancPluginWorklistAnswersOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4459 params.answers = answers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4460 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4461 params.dicom = dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4462 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4463 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4464 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4465 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4466 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4467 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4468 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4469 * @brief Mark the set of worklist answers as incomplete. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4470 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4471 * This function marks as incomplete the set of answers |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4472 * corresponding to some C-Find SCP request against modality |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4473 * worklists. This must be used if canceling the handling of a |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4474 * request when too many answers are to be returned. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4475 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4476 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4477 * @param answers The set of answers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4478 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4479 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4480 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4481 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4482 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4483 OrthancPluginWorklistAnswers* answers) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4484 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4485 _OrthancPluginWorklistAnswersOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4486 params.answers = answers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4487 params.query = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4488 params.dicom = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4489 params.size = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4490 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4491 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4492 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4493 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4494 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4495 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4496 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4497 const OrthancPluginWorklistQuery* query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4498 const void* dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4499 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4500 int32_t* isMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4501 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4502 } _OrthancPluginWorklistQueryOperation; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4503 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4504 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4505 * @brief Test whether a worklist matches the query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4506 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4507 * This function checks whether one worklist (encoded as a DICOM |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4508 * file) matches the C-Find SCP query against modality |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4509 * worklists. This function must be called before adding the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4510 * worklist as an answer through OrthancPluginWorklistAddAnswer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4511 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4512 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4513 * @param query The worklist query, as received by the callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4514 * @param dicom The worklist to answer, encoded as a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4515 * @param size The size of the DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4516 * @return 1 if the worklist matches the query, 0 otherwise. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4517 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4518 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4519 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4520 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4521 const OrthancPluginWorklistQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4522 const void* dicom, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4523 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4524 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4525 int32_t isMatch = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4526 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4527 _OrthancPluginWorklistQueryOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4528 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4529 params.dicom = dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4530 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4531 params.isMatch = &isMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4532 params.target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4533 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4534 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, ¶ms) == OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4535 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4536 return isMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4537 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4538 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4539 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4540 /* Error: Assume non-match */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4541 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4542 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4543 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4544 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4545 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4546 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4547 * @brief Retrieve the worklist query as a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4548 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4549 * This function retrieves the DICOM file that underlies a C-Find |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4550 * SCP query against modality worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4551 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4552 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4553 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4554 * @param query The worklist query, as received by the callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4555 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4556 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4557 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4558 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4559 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4560 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4561 const OrthancPluginWorklistQuery* query) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4562 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4563 _OrthancPluginWorklistQueryOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4564 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4565 params.dicom = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4566 params.size = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4567 params.isMatch = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4568 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4569 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4570 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4571 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4572 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4573 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4574 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4575 * @brief Get the origin of a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4576 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4577 * This function returns the origin of a DICOM instance that has been received by Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4578 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4579 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4580 * @param instance The instance of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4581 * @return The origin of the instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4582 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4583 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4584 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4585 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4586 OrthancPluginDicomInstance* instance) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4587 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4588 OrthancPluginInstanceOrigin origin; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4589 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4590 _OrthancPluginAccessDicomInstance params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4591 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4592 params.resultOrigin = &origin; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4593 params.instance = instance; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4594 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4595 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4596 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4597 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4598 return OrthancPluginInstanceOrigin_Unknown; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4599 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4600 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4601 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4602 return origin; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4603 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4604 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4605 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4606 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4607 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4608 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4609 OrthancPluginMemoryBuffer* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4610 const char* json; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4611 const OrthancPluginImage* pixelData; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4612 OrthancPluginCreateDicomFlags flags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4613 } _OrthancPluginCreateDicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4614 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4615 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4616 * @brief Create a DICOM instance from a JSON string and an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4617 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4618 * This function takes as input a string containing a JSON file |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4619 * describing the content of a DICOM instance. As an output, it |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4620 * writes the corresponding DICOM instance to a newly allocated |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4621 * memory buffer. Additionally, an image to be encoded within the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4622 * DICOM instance can also be provided. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4623 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4624 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4625 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4626 * @param json The input JSON file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4627 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4628 * @param flags Flags governing the output. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4629 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4630 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4631 * @see OrthancPluginDicomBufferToJson |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4632 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4633 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4634 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4635 OrthancPluginMemoryBuffer* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4636 const char* json, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4637 const OrthancPluginImage* pixelData, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4638 OrthancPluginCreateDicomFlags flags) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4639 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4640 _OrthancPluginCreateDicom params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4641 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4642 params.json = json; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4643 params.pixelData = pixelData; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4644 params.flags = flags; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4645 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4646 return context->InvokeService(context, _OrthancPluginService_CreateDicom, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4647 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4648 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4649 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4650 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4651 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4652 OrthancPluginDecodeImageCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4653 } _OrthancPluginDecodeImageCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4654 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4655 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4656 * @brief Register a callback to handle the decoding of DICOM images. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4657 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4658 * This function registers a custom callback to the decoding of |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4659 * DICOM images, replacing the built-in decoder of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4660 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4661 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4662 * @param callback The callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4663 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4664 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4665 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4666 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4667 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4668 OrthancPluginDecodeImageCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4669 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4670 _OrthancPluginDecodeImageCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4671 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4672 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4673 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4674 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4675 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4676 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4677 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4678 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4679 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4680 OrthancPluginImage** target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4681 OrthancPluginPixelFormat format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4682 uint32_t width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4683 uint32_t height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4684 uint32_t pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4685 void* buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4686 const void* constBuffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4687 uint32_t bufferSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4688 uint32_t frameIndex; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4689 } _OrthancPluginCreateImage; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4690 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4691 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4692 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4693 * @brief Create an image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4694 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4695 * This function creates an image of given size and format. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4696 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4697 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4698 * @param format The format of the pixels. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4699 * @param width The width of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4700 * @param height The height of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4701 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4702 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4703 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4704 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4705 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4706 OrthancPluginPixelFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4707 uint32_t width, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4708 uint32_t height) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4709 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4710 OrthancPluginImage* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4711 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4712 _OrthancPluginCreateImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4713 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4714 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4715 params.format = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4716 params.width = width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4717 params.height = height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4718 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4719 if (context->InvokeService(context, _OrthancPluginService_CreateImage, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4720 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4721 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4722 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4723 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4724 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4725 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4726 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4727 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4728 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4729 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4730 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4731 * @brief Create an image pointing to a memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4732 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4733 * This function creates an image whose content points to a memory |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4734 * buffer managed by the plugin. Note that the buffer is directly |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4735 * accessed, no memory is allocated and no data is copied. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4736 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4737 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4738 * @param format The format of the pixels. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4739 * @param width The width of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4740 * @param height The height of the image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4741 * @param pitch The pitch of the image (i.e. the number of bytes |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4742 * between 2 successive lines of the image in the memory buffer). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4743 * @param buffer The memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4744 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4745 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4746 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4747 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4748 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4749 OrthancPluginPixelFormat format, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4750 uint32_t width, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4751 uint32_t height, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4752 uint32_t pitch, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4753 void* buffer) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4754 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4755 OrthancPluginImage* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4756 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4757 _OrthancPluginCreateImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4758 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4759 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4760 params.format = format; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4761 params.width = width; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4762 params.height = height; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4763 params.pitch = pitch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4764 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4765 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4766 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4767 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4768 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4769 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4770 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4771 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4772 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4773 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4774 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4775 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4776 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4777 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4778 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4779 * @brief Decode one frame from a DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4780 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4781 * This function decodes one frame of a DICOM image that is stored |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4782 * in a memory buffer. This function will give the same result as |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4783 * OrthancPluginUncompressImage() for single-frame DICOM images. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4784 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4785 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4786 * @param buffer Pointer to a memory buffer containing the DICOM image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4787 * @param bufferSize Size of the memory buffer containing the DICOM image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4788 * @param frameIndex The index of the frame of interest in a multi-frame image. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4789 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4790 * @ingroup Images |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4791 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4792 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4793 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4794 const void* buffer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4795 uint32_t bufferSize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4796 uint32_t frameIndex) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4797 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4798 OrthancPluginImage* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4799 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4800 _OrthancPluginCreateImage params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4801 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4802 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4803 params.constBuffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4804 params.bufferSize = bufferSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4805 params.frameIndex = frameIndex; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4806 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4807 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4808 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4809 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4810 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4811 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4812 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4813 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4814 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4815 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4816 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4817 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4818 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4819 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4820 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4821 char** result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4822 const void* buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4823 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4824 } _OrthancPluginComputeHash; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4825 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4826 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4827 * @brief Compute an MD5 hash. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4828 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4829 * This functions computes the MD5 cryptographic hash of the given memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4830 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4831 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4832 * @param buffer The source memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4833 * @param size The size in bytes of the source buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4834 * @return The NULL value in case of error, or a string containing the cryptographic hash. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4835 * This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4836 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4837 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4838 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4839 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4840 const void* buffer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4841 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4842 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4843 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4844 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4845 _OrthancPluginComputeHash params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4846 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4847 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4848 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4849 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4850 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4851 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4852 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4853 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4854 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4855 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4856 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4857 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4858 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4859 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4860 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4861 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4862 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4863 * @brief Compute a SHA-1 hash. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4864 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4865 * This functions computes the SHA-1 cryptographic hash of the given memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4866 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4867 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4868 * @param buffer The source memory buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4869 * @param size The size in bytes of the source buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4870 * @return The NULL value in case of error, or a string containing the cryptographic hash. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4871 * This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4872 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4873 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4874 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4875 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4876 const void* buffer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4877 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4878 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4879 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4880 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4881 _OrthancPluginComputeHash params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4882 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4883 params.buffer = buffer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4884 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4885 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4886 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4887 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4888 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4889 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4890 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4891 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4892 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4893 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4894 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4895 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4896 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4897 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4898 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4899 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4900 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4901 OrthancPluginDictionaryEntry* target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4902 const char* name; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4903 } _OrthancPluginLookupDictionary; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4904 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4905 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4906 * @brief Get information about the given DICOM tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4907 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4908 * This functions makes a lookup in the dictionary of DICOM tags |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4909 * that are known to Orthanc, and returns information about this |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4910 * tag. The tag can be specified using its human-readable name |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4911 * (e.g. "PatientName") or a set of two hexadecimal numbers |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4912 * (e.g. "0010-0020"). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4913 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4914 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4915 * @param target Where to store the information about the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4916 * @param name The name of the DICOM tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4917 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4918 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4919 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4920 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4921 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4922 OrthancPluginDictionaryEntry* target, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4923 const char* name) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4924 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4925 _OrthancPluginLookupDictionary params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4926 params.target = target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4927 params.name = name; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4928 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4929 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4930 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4931 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4932 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4933 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4934 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4935 OrthancPluginRestOutput* output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4936 const char* answer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4937 uint32_t answerSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4938 uint32_t headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4939 const char* const* headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4940 const char* const* headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4941 } _OrthancPluginSendMultipartItem2; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4942 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4943 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4944 * @brief Send an item as a part of some HTTP multipart answer, with custom headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4945 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4946 * This function sends an item as a part of some HTTP multipart |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4947 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4948 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4949 * with the item. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4950 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4951 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4952 * @param output The HTTP connection to the client application. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4953 * @param answer Pointer to the memory buffer containing the item. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4954 * @param answerSize Number of bytes of the item. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4955 * @param headersCount The number of HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4956 * @param headersKeys Array containing the keys of the HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4957 * @param headersValues Array containing the values of the HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4958 * @return 0 if success, or the error code if failure (this notably happens |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4959 * if the connection is closed by the client). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4960 * @see OrthancPluginSendMultipartItem() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4961 * @ingroup REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4962 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4963 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4964 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4965 OrthancPluginRestOutput* output, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4966 const char* answer, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4967 uint32_t answerSize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4968 uint32_t headersCount, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4969 const char* const* headersKeys, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4970 const char* const* headersValues) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4971 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4972 _OrthancPluginSendMultipartItem2 params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4973 params.output = output; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4974 params.answer = answer; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4975 params.answerSize = answerSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4976 params.headersCount = headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4977 params.headersKeys = headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4978 params.headersValues = headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4979 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4980 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4981 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4982 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4983 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4984 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4985 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4986 OrthancPluginIncomingHttpRequestFilter callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4987 } _OrthancPluginIncomingHttpRequestFilter; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4988 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4989 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4990 * @brief Register a callback to filter incoming HTTP requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4991 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4992 * This function registers a custom callback to filter incoming HTTP/REST |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4993 * requests received by the HTTP server of Orthanc. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4994 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4995 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4996 * @param callback The callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4997 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4998 * @ingroup Callbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4999 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5000 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5001 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5002 OrthancPluginIncomingHttpRequestFilter callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5003 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5004 _OrthancPluginIncomingHttpRequestFilter params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5005 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5006 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5007 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5008 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5009 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5010 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5011 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5012 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5013 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5014 OrthancPluginMemoryBuffer* answerBody; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5015 OrthancPluginMemoryBuffer* answerHeaders; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5016 uint16_t* httpStatus; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5017 OrthancPluginHttpMethod method; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5018 const char* url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5019 uint32_t headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5020 const char* const* headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5021 const char* const* headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5022 const char* body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5023 uint32_t bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5024 const char* username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5025 const char* password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5026 uint32_t timeout; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5027 const char* certificateFile; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5028 const char* certificateKeyFile; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5029 const char* certificateKeyPassword; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5030 uint8_t pkcs11; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5031 } _OrthancPluginCallHttpClient2; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5032 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5033 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5034 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5035 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5036 * @brief Issue a HTTP call with full flexibility. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5037 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5038 * Make a HTTP call to the given URL. The result to the query is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5039 * stored into a newly allocated memory buffer. The HTTP request |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5040 * will be done accordingly to the global configuration of Orthanc |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5041 * (in particular, the options "HttpProxy", "HttpTimeout", |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5042 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5043 * taken into account). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5044 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5045 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5046 * @param answerBody The target memory buffer (out argument). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5047 * It must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5048 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5049 * The answer headers are formatted as a JSON object (associative array). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5050 * The buffer must be freed with OrthancPluginFreeMemoryBuffer(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5051 * This argument can be set to NULL if the plugin has no interest in the HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5052 * @param httpStatus The HTTP status after the execution of the request (out argument). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5053 * @param method HTTP method to be used. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5054 * @param url The URL of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5055 * @param headersCount The number of HTTP headers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5056 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5057 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5058 * @param username The username (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5059 * @param password The password (can be <tt>NULL</tt> if no password protection). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5060 * @param body The body of the POST request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5061 * @param bodySize The size of the body. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5062 * @param timeout Timeout in seconds (0 for default timeout). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5063 * @param certificateFile Path to the client certificate for HTTPS, in PEM format |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5064 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5065 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5066 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5067 * @param certificateKeyPassword Password to unlock the key of the client certificate |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5068 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5069 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5070 * @return 0 if success, or the error code if failure. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5071 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5072 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5073 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5074 OrthancPluginMemoryBuffer* answerBody, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5075 OrthancPluginMemoryBuffer* answerHeaders, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5076 uint16_t* httpStatus, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5077 OrthancPluginHttpMethod method, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5078 const char* url, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5079 uint32_t headersCount, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5080 const char* const* headersKeys, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5081 const char* const* headersValues, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5082 const char* body, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5083 uint32_t bodySize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5084 const char* username, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5085 const char* password, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5086 uint32_t timeout, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5087 const char* certificateFile, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5088 const char* certificateKeyFile, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5089 const char* certificateKeyPassword, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5090 uint8_t pkcs11) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5091 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5092 _OrthancPluginCallHttpClient2 params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5093 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5094 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5095 params.answerBody = answerBody; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5096 params.answerHeaders = answerHeaders; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5097 params.httpStatus = httpStatus; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5098 params.method = method; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5099 params.url = url; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5100 params.headersCount = headersCount; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5101 params.headersKeys = headersKeys; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5102 params.headersValues = headersValues; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5103 params.body = body; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5104 params.bodySize = bodySize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5105 params.username = username; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5106 params.password = password; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5107 params.timeout = timeout; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5108 params.certificateFile = certificateFile; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5109 params.certificateKeyFile = certificateKeyFile; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5110 params.certificateKeyPassword = certificateKeyPassword; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5111 params.pkcs11 = pkcs11; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5112 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5113 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5114 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5115 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5116 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5117 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5118 * @brief Generate an UUID. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5119 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5120 * Generate a random GUID/UUID (globally unique identifier). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5121 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5122 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5123 * @return NULL in the case of an error, or a newly allocated string |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5124 * containing the UUID. This string must be freed by OrthancPluginFreeString(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5125 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5126 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5127 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5128 OrthancPluginContext* context) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5129 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5130 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5131 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5132 _OrthancPluginRetrieveDynamicString params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5133 params.result = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5134 params.argument = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5135 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5136 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5137 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5138 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5139 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5140 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5141 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5142 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5143 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5144 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5145 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5146 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5147 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5148 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5149 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5150 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5151 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5152 OrthancPluginFindCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5153 } _OrthancPluginFindCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5154 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5155 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5156 * @brief Register a callback to handle C-Find requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5157 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5158 * This function registers a callback to handle C-Find SCP requests |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5159 * that are not related to modality worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5160 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5161 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5162 * @param callback The callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5163 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5164 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5165 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5166 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5167 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5168 OrthancPluginFindCallback callback) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5169 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5170 _OrthancPluginFindCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5171 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5172 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5173 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5174 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5175 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5176 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5177 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5178 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5179 OrthancPluginFindAnswers *answers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5180 const OrthancPluginFindQuery *query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5181 const void *dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5182 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5183 uint32_t index; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5184 uint32_t *resultUint32; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5185 uint16_t *resultGroup; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5186 uint16_t *resultElement; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5187 char **resultString; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5188 } _OrthancPluginFindOperation; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5189 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5190 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5191 * @brief Add one answer to some C-Find request. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5192 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5193 * This function adds one answer (encoded as a DICOM file) to the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5194 * set of answers corresponding to some C-Find SCP request that is |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5195 * not related to modality worklists. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5196 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5197 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5198 * @param answers The set of answers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5199 * @param dicom The answer to be added, encoded as a DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5200 * @param size The size of the DICOM file. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5201 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5202 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5203 * @see OrthancPluginCreateDicom() |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5204 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5205 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5206 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5207 OrthancPluginFindAnswers* answers, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5208 const void* dicom, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5209 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5210 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5211 _OrthancPluginFindOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5212 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5213 params.answers = answers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5214 params.dicom = dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5215 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5216 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5217 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5218 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5219 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5220 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5221 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5222 * @brief Mark the set of C-Find answers as incomplete. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5223 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5224 * This function marks as incomplete the set of answers |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5225 * corresponding to some C-Find SCP request that is not related to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5226 * modality worklists. This must be used if canceling the handling |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5227 * of a request when too many answers are to be returned. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5228 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5229 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5230 * @param answers The set of answers. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5231 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5232 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5233 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5234 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5235 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5236 OrthancPluginFindAnswers* answers) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5237 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5238 _OrthancPluginFindOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5239 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5240 params.answers = answers; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5241 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5242 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5243 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5244 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5245 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5246 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5247 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5248 * @brief Get the number of tags in a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5249 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5250 * This function returns the number of tags that are contained in |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5251 * the given C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5252 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5253 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5254 * @param query The C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5255 * @return The number of tags. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5256 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5257 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5258 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5259 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5260 const OrthancPluginFindQuery* query) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5261 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5262 uint32_t count = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5263 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5264 _OrthancPluginFindOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5265 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5266 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5267 params.resultUint32 = &count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5268 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5269 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5270 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5271 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5272 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5273 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5274 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5275 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5276 return count; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5277 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5278 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5279 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5280 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5281 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5282 * @brief Get one tag in a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5283 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5284 * This function returns the group and the element of one DICOM tag |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5285 * in the given C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5286 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5287 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5288 * @param group The group of the tag (output). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5289 * @param element The element of the tag (output). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5290 * @param query The C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5291 * @param index The index of the tag of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5292 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5293 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5294 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5295 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5296 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5297 uint16_t* group, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5298 uint16_t* element, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5299 const OrthancPluginFindQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5300 uint32_t index) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5301 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5302 _OrthancPluginFindOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5303 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5304 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5305 params.index = index; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5306 params.resultGroup = group; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5307 params.resultElement = element; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5308 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5309 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5310 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5311 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5312 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5313 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5314 * @brief Get the symbolic name of one tag in a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5315 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5316 * This function returns the symbolic name of one DICOM tag in the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5317 * given C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5318 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5319 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5320 * @param query The C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5321 * @param index The index of the tag of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5322 * @return The NULL value in case of error, or a string containing the name of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5323 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5324 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5325 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5326 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5327 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5328 const OrthancPluginFindQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5329 uint32_t index) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5330 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5331 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5332 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5333 _OrthancPluginFindOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5334 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5335 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5336 params.index = index; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5337 params.resultString = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5338 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5339 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5340 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5341 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5342 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5343 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5344 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5345 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5346 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5347 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5348 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5349 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5350 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5351 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5352 * @brief Get the value associated with one tag in a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5353 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5354 * This function returns the value associated with one tag in the |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5355 * given C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5356 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5357 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5358 * @param query The C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5359 * @param index The index of the tag of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5360 * @return The NULL value in case of error, or a string containing the value of the tag. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5361 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5362 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5363 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5364 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5365 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5366 const OrthancPluginFindQuery* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5367 uint32_t index) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5368 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5369 char* result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5370 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5371 _OrthancPluginFindOperation params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5372 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5373 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5374 params.index = index; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5375 params.resultString = &result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5376 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5377 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5378 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5379 /* Error */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5380 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5381 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5382 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5383 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5384 return result; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5385 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5386 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5387 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5388 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5389 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5390 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5391 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5392 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5393 OrthancPluginMoveCallback callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5394 OrthancPluginGetMoveSize getMoveSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5395 OrthancPluginApplyMove applyMove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5396 OrthancPluginFreeMove freeMove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5397 } _OrthancPluginMoveCallback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5398 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5399 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5400 * @brief Register a callback to handle C-Move requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5401 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5402 * This function registers a callback to handle C-Move SCP requests. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5403 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5404 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5405 * @param callback The main callback. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5406 * @param getMoveSize Callback to read the number of C-Move suboperations. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5407 * @param applyMove Callback to apply one C-Move suboperations. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5408 * @param freeMove Callback to free the C-Move driver. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5409 * @return 0 if success, other value if error. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5410 * @ingroup DicomCallbacks |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5411 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5412 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5413 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5414 OrthancPluginMoveCallback callback, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5415 OrthancPluginGetMoveSize getMoveSize, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5416 OrthancPluginApplyMove applyMove, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5417 OrthancPluginFreeMove freeMove) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5418 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5419 _OrthancPluginMoveCallback params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5420 params.callback = callback; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5421 params.getMoveSize = getMoveSize; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5422 params.applyMove = applyMove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5423 params.freeMove = freeMove; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5424 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5425 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5426 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5427 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5428 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5429 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5430 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5431 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5432 OrthancPluginFindMatcher** target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5433 const void* query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5434 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5435 } _OrthancPluginCreateFindMatcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5436 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5437 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5438 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5439 * @brief Create a C-Find matcher. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5440 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5441 * This function creates a "matcher" object that can be used to |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5442 * check whether a DICOM instance matches a C-Find query. The C-Find |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5443 * query must be expressed as a DICOM buffer. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5444 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5445 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5446 * @param query The C-Find DICOM query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5447 * @param size The size of the DICOM query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5448 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5449 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5450 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5451 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5452 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5453 const void* query, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5454 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5455 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5456 OrthancPluginFindMatcher* target = NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5457 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5458 _OrthancPluginCreateFindMatcher params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5459 memset(¶ms, 0, sizeof(params)); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5460 params.target = ⌖ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5461 params.query = query; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5462 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5463 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5464 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, ¶ms) != OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5465 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5466 return NULL; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5467 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5468 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5469 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5470 return target; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5471 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5472 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5473 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5474 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5475 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5476 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5477 OrthancPluginFindMatcher* matcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5478 } _OrthancPluginFreeFindMatcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5479 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5480 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5481 * @brief Free a C-Find matcher. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5482 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5483 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5484 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5485 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5486 * @param matcher The matcher of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5487 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5488 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5489 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5490 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5491 OrthancPluginFindMatcher* matcher) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5492 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5493 _OrthancPluginFreeFindMatcher params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5494 params.matcher = matcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5495 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5496 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, ¶ms); |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5497 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5498 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5499 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5500 typedef struct |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5501 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5502 const OrthancPluginFindMatcher* matcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5503 const void* dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5504 uint32_t size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5505 int32_t* isMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5506 } _OrthancPluginFindMatcherIsMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5507 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5508 /** |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5509 * @brief Test whether a DICOM instance matches a C-Find query. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5510 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5511 * This function checks whether one DICOM instance matches C-Find |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5512 * matcher that was previously allocated using |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5513 * OrthancPluginCreateFindMatcher(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5514 * |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5515 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5516 * @param matcher The matcher of interest. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5517 * @param dicom The DICOM instance to be matched. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5518 * @param size The size of the DICOM instance. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5519 * @return 1 if the DICOM instance matches the query, 0 otherwise. |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5520 * @ingroup Toolbox |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5521 **/ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5522 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch( |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5523 OrthancPluginContext* context, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5524 const OrthancPluginFindMatcher* matcher, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5525 const void* dicom, |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5526 uint32_t size) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5527 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5528 int32_t isMatch = 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5529 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5530 _OrthancPluginFindMatcherIsMatch params; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5531 params.matcher = matcher; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5532 params.dicom = dicom; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5533 params.size = size; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5534 params.isMatch = &isMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5535 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5536 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, ¶ms) == OrthancPluginErrorCode_Success) |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5537 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5538 return isMatch; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5539 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5540 else |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5541 { |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5542 /* Error: Assume non-match */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5543 return 0; |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5544 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5545 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5546 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5547 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5548 #ifdef __cplusplus |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5549 } |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5550 #endif |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5551 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5552 |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5553 /** @} */ |
0a408a81fb15
upgraded Orthanc SDK to 1.2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5554 |