Mercurial > hg > orthanc
annotate Plugins/OrthancCPlugin/OrthancCPlugin.h @ 1248:db753e57934f
ErrorCode_Database
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 09 Dec 2014 12:17:59 +0100 |
parents | eac00401cb96 |
children | 40725595aaf0 |
rev | line source |
---|---|
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
1 /** |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
2 * \mainpage |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
3 * |
907 | 4 * This C/C++ SDK allows external developers to create plugins that |
5 * can be loaded into Orthanc to extend its functionality. Each | |
6 * Orthanc plugin must expose 4 public functions with the following | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
7 * signatures: |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
8 * |
907 | 9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>: |
10 * This function is invoked by Orthanc when it loads the plugin on startup. | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
11 * The plugin must: |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
12 * - Check its compatibility with the Orthanc version using |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
13 * ::OrthancPluginCheckVersion(). |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
14 * - Store the context pointer so that it can use the plugin |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
15 * services of Orthanc. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback(). |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
17 * - Register all its callbacks for received instances using ::OrthancPluginRegisterOnStoredInstanceCallback(). |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
18 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea(). |
907 | 19 * -# <tt>void OrthancPluginFinalize()</tt>: |
20 * This function is invoked by Orthanc during its shutdown. The plugin | |
21 * must free all its memory. | |
22 * -# <tt>const char* OrthancPluginGetName()</tt>: | |
23 * The plugin must return a short string to identify itself. | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
24 * -# <tt>const char* OrthancPluginGetVersion()</tt>: |
907 | 25 * The plugin must return a string containing its version number. |
26 * | |
27 * The name and the version of a plugin is only used to prevent it | |
28 * from being loaded twice. | |
29 * | |
1187 | 30 * The various callbacks are guaranteed to be executed in mutual |
31 * exclusion since Orthanc 0.8.5. | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
32 **/ |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
33 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
34 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
35 |
900 | 36 /** |
37 * @defgroup CInterface C Interface | |
38 * @brief The C interface to create Orthanc plugins. | |
39 * | |
40 * These functions must be used to create C plugins for Orthanc. | |
41 **/ | |
42 | |
43 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
44 |
886 | 45 /** |
46 * Orthanc - A Lightweight, RESTful DICOM Store | |
47 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, | |
48 * Belgium | |
49 * | |
50 * This program is free software: you can redistribute it and/or | |
51 * modify it under the terms of the GNU General Public License as | |
52 * published by the Free Software Foundation, either version 3 of the | |
53 * License, or (at your option) any later version. | |
54 * | |
55 * In addition, as a special exception, the copyright holders of this | |
56 * program give permission to link the code of its release with the | |
57 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
58 * that use the same license as the "OpenSSL" library), and distribute | |
59 * the linked executables. You must obey the GNU General Public License | |
60 * in all respects for all of the code used other than "OpenSSL". If you | |
61 * modify file(s) with this exception, you may extend this exception to | |
62 * your version of the file(s), but you are not obligated to do so. If | |
63 * you do not wish to do so, delete this exception statement from your | |
64 * version. If you delete this exception statement from all source files | |
65 * in the program, then also delete it here. | |
66 * | |
67 * This program is distributed in the hope that it will be useful, but | |
68 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
69 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
70 * General Public License for more details. | |
71 * | |
72 * You should have received a copy of the GNU General Public License | |
73 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
74 **/ | |
75 | |
76 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
77 |
886 | 78 #pragma once |
79 | |
80 | |
900 | 81 #include <stdio.h> |
82 #include <string.h> | |
83 | |
886 | 84 #ifdef WIN32 |
85 #define ORTHANC_PLUGINS_API __declspec(dllexport) | |
86 #else | |
87 #define ORTHANC_PLUGINS_API | |
88 #endif | |
89 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
90 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 0 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
91 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 8 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
92 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 5 |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
93 |
886 | 94 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
95 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
96 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
97 ** Check that function inlining is properly supported. The use of |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
98 ** inlining is required, to avoid the duplication of object code |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
99 ** between two compilation modules that would use the Orthanc Plugin |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
100 ** API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
101 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
102 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
103 /* If the auto-detection of the "inline" keyword below does not work |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
104 automatically and that your compiler is known to properly support |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
105 inlining, uncomment the following #define and adapt the definition |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
106 of "static inline". */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
107 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
108 /* #define ORTHANC_PLUGIN_INLINE static inline */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
109 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
110 #ifndef ORTHANC_PLUGIN_INLINE |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
111 # if __STDC_VERSION__ >= 199901L |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
112 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
113 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
114 # elif defined(__cplusplus) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
115 /* This is C++ */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
116 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
117 # elif defined(__GNUC__) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
118 /* This is GCC running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
119 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
120 # elif defined(_MSC_VER) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
121 /* This is Visual Studio running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
122 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
123 # else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
124 # error Your compiler is not known to support the "inline" keyword |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
125 # endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
126 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
127 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
128 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
129 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
130 /******************************************************************** |
907 | 131 ** Inclusion of standard libraries. |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
132 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
133 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
134 #ifdef _MSC_VER |
1027 | 135 #include "../../Resources/ThirdParty/VisualStudio/stdint.h" |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
136 #else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
137 #include <stdint.h> |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
138 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
139 |
886 | 140 #include <stdlib.h> |
141 | |
142 | |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
143 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
144 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
145 ** Definition of the Orthanc Plugin API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
146 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
147 |
900 | 148 /** @{ */ |
149 | |
886 | 150 #ifdef __cplusplus |
151 extern "C" | |
152 { | |
153 #endif | |
154 | |
907 | 155 /** |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
156 * Forward declaration of one of the mandatory functions for Orthanc |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
157 * plugins. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
158 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
159 ORTHANC_PLUGINS_API const char* OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
160 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
161 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
162 /** |
907 | 163 * The various HTTP methods for a REST call. |
164 **/ | |
894 | 165 typedef enum |
166 { | |
907 | 167 OrthancPluginHttpMethod_Get = 1, /*!< GET request */ |
168 OrthancPluginHttpMethod_Post = 2, /*!< POST request */ | |
169 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */ | |
170 OrthancPluginHttpMethod_Delete = 4 /*!< DELETE request */ | |
896 | 171 } OrthancPluginHttpMethod; |
886 | 172 |
907 | 173 |
174 /** | |
175 * @brief The parameters of a REST request. | |
176 **/ | |
899 | 177 typedef struct |
178 { | |
907 | 179 /** |
180 * @brief The HTTP method. | |
181 **/ | |
182 OrthancPluginHttpMethod method; | |
899 | 183 |
907 | 184 /** |
185 * @brief The number of groups of the regular expression. | |
186 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
187 uint32_t groupsCount; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
188 |
907 | 189 /** |
190 * @brief The matched values for the groups of the regular expression. | |
191 **/ | |
192 const char* const* groups; | |
193 | |
194 /** | |
195 * @brief For a GET request, the number of GET parameters. | |
196 **/ | |
899 | 197 uint32_t getCount; |
198 | |
907 | 199 /** |
200 * @brief For a GET request, the keys of the GET parameters. | |
201 **/ | |
202 const char* const* getKeys; | |
203 | |
204 /** | |
205 * @brief For a GET request, the values of the GET parameters. | |
206 **/ | |
207 const char* const* getValues; | |
208 | |
209 /** | |
210 * @brief For a PUT or POST request, the content of the body. | |
211 **/ | |
899 | 212 const char* body; |
907 | 213 |
214 /** | |
215 * @brief For a PUT or POST request, the number of bytes of the body. | |
216 **/ | |
899 | 217 uint32_t bodySize; |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
218 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
219 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
220 /* -------------------------------------------------- |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
221 New in version 0.8.1 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
222 -------------------------------------------------- */ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
223 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
224 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
225 * @brief The number of HTTP headers. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
226 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
227 uint32_t headersCount; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
228 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
229 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
230 * @brief The keys of the HTTP headers (always converted to low-case). |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
231 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
232 const char* const* headersKeys; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
233 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
234 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
235 * @brief The values of the HTTP headers. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
236 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
237 const char* const* headersValues; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
238 |
899 | 239 } OrthancPluginHttpRequest; |
240 | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
241 |
900 | 242 typedef enum |
886 | 243 { |
900 | 244 /* Generic services */ |
907 | 245 _OrthancPluginService_LogInfo = 1, |
246 _OrthancPluginService_LogWarning = 2, | |
247 _OrthancPluginService_LogError = 3, | |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
248 _OrthancPluginService_GetOrthancPath = 4, |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
249 _OrthancPluginService_GetOrthancDirectory = 5, |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
250 _OrthancPluginService_GetConfigurationPath = 6, |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
251 _OrthancPluginService_SetProperty = 7, |
900 | 252 |
253 /* Registration of callbacks */ | |
907 | 254 _OrthancPluginService_RegisterRestCallback = 1000, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
255 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001, |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
256 _OrthancPluginService_RegisterStorageArea = 1002, |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
257 _OrthancPluginService_RegisterOnChangeCallback = 1003, |
900 | 258 |
259 /* Sending answers to REST calls */ | |
907 | 260 _OrthancPluginService_AnswerBuffer = 2000, |
261 _OrthancPluginService_CompressAndAnswerPngImage = 2001, | |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
262 _OrthancPluginService_Redirect = 2002, |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
263 _OrthancPluginService_SendHttpStatusCode = 2003, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
264 _OrthancPluginService_SendUnauthorized = 2004, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
265 _OrthancPluginService_SendMethodNotAllowed = 2005, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
266 _OrthancPluginService_SetCookie = 2006, |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
267 _OrthancPluginService_SetHttpHeader = 2007, |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
268 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
269 /* Access to the Orthanc database and API */ |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
270 _OrthancPluginService_GetDicomForInstance = 3000, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
271 _OrthancPluginService_RestApiGet = 3001, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
272 _OrthancPluginService_RestApiPost = 3002, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
273 _OrthancPluginService_RestApiDelete = 3003, |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
274 _OrthancPluginService_RestApiPut = 3004, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
275 _OrthancPluginService_LookupPatient = 3005, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
276 _OrthancPluginService_LookupStudy = 3006, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
277 _OrthancPluginService_LookupSeries = 3007, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
278 _OrthancPluginService_LookupInstance = 3008, |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
279 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
280 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
281 /* Access to DICOM instances */ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
282 _OrthancPluginService_GetInstanceRemoteAet = 4000, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
283 _OrthancPluginService_GetInstanceSize = 4001, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
284 _OrthancPluginService_GetInstanceData = 4002, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
285 _OrthancPluginService_GetInstanceJson = 4003, |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
286 _OrthancPluginService_GetInstanceSimplifiedJson = 4004, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
287 _OrthancPluginService_HasInstanceMetadata = 4005, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
288 _OrthancPluginService_GetInstanceMetadata = 4006 |
907 | 289 } _OrthancPluginService; |
900 | 290 |
291 | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
292 typedef enum |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
293 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
294 _OrthancPluginProperty_Description = 1, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
295 _OrthancPluginProperty_RootUri = 2, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
296 _OrthancPluginProperty_OrthancExplorer = 3 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
297 } _OrthancPluginProperty; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
298 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
299 |
900 | 300 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
301 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
302 * The memory layout of the pixels of an image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
303 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
304 typedef enum |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
305 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
306 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
307 * @brief Graylevel 8bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
308 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
309 * The image is graylevel. Each pixel is unsigned and stored in |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
310 * one byte. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
311 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
312 OrthancPluginPixelFormat_Grayscale8 = 1, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
313 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
314 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
315 * @brief Graylevel, unsigned 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
316 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
317 * The image is graylevel. Each pixel is unsigned and stored in |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
318 * two bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
319 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
320 OrthancPluginPixelFormat_Grayscale16 = 2, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
321 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
322 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
323 * @brief Graylevel, signed 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
324 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
325 * The image is graylevel. Each pixel is signed and stored in two |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
326 * bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
327 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
328 OrthancPluginPixelFormat_SignedGrayscale16 = 3, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
329 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
330 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
331 * @brief Color image in RGB24 format. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
332 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
333 * This format describes a color image. The pixels are stored in 3 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
334 * consecutive bytes. The memory layout is RGB. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
335 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
336 OrthancPluginPixelFormat_RGB24 = 4, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
337 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
338 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
339 * @brief Color image in RGBA32 format. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
340 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
341 * This format describes a color image. The pixels are stored in 4 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
342 * consecutive bytes. The memory layout is RGBA. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
343 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
344 OrthancPluginPixelFormat_RGBA32 = 5 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
345 } OrthancPluginPixelFormat; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
346 |
894 | 347 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
348 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
349 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
350 * The content types that are supported by Orthanc plugins. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
351 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
352 typedef enum |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
353 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
354 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
355 OrthancPluginContentType_Dicom = 1, /*!< DICOM */ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
356 OrthancPluginContentType_DicomAsJson = 2 /*!< JSON summary of a DICOM file */ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
357 } OrthancPluginContentType; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
358 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
359 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
360 |
907 | 361 /** |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
362 * The supported type of DICOM resources. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
363 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
364 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
365 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
366 OrthancPluginResourceType_Patient = 0, /*!< Patient */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
367 OrthancPluginResourceType_Study = 1, /*!< Study */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
368 OrthancPluginResourceType_Series = 2, /*!< Series */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
369 OrthancPluginResourceType_Instance = 3 /*!< Instance */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
370 } OrthancPluginResourceType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
371 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
372 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
373 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
374 /** |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
375 * The supported type of changes that can happen to DICOM resources. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
376 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
377 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
378 { |
1198 | 379 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */ |
380 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */ | |
381 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */ | |
382 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */ | |
383 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */ | |
384 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */ | |
385 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */ | |
386 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */ | |
387 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */ | |
388 OrthancPluginChangeType_StableStudy = 9 /*!< Timeout: No new instance in this study */ | |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
389 } OrthancPluginChangeType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
390 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
391 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
392 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
393 /** |
907 | 394 * @brief A memory buffer allocated by the core system of Orthanc. |
395 * | |
396 * A memory buffer allocated by the core system of Orthanc. When the | |
397 * content of the buffer is not useful anymore, it must be free by a | |
398 * call to ::OrthancPluginFreeMemoryBuffer(). | |
399 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
400 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
401 { |
907 | 402 /** |
403 * @brief The content of the buffer. | |
404 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
405 void* data; |
907 | 406 |
407 /** | |
408 * @brief The number of bytes in the buffer. | |
409 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
410 uint32_t size; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
411 } OrthancPluginMemoryBuffer; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
412 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
413 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
414 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
415 |
907 | 416 /** |
417 * @brief Opaque structure that represents the HTTP connection to the client application. | |
418 **/ | |
900 | 419 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput; |
420 | |
907 | 421 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
422 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
423 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
424 * @brief Opaque structure that represents a DICOM instance received by Orthanc. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
425 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
426 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
427 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
428 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
429 |
907 | 430 /** |
908
e078ea944089
refactoring HttpOutput
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
907
diff
changeset
|
431 * @brief Signature of a callback function that answers to a REST request. |
907 | 432 **/ |
900 | 433 typedef int32_t (*OrthancPluginRestCallback) ( |
434 OrthancPluginRestOutput* output, | |
435 const char* url, | |
436 const OrthancPluginHttpRequest* request); | |
437 | |
907 | 438 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
439 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
440 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
441 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
442 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
443 typedef int32_t (*OrthancPluginOnStoredInstanceCallback) ( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
444 OrthancPluginDicomInstance* instance, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
445 const char* instanceId); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
446 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
447 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
448 |
907 | 449 /** |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
450 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
451 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
452 typedef int32_t (*OrthancPluginOnChangeCallback) ( |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
453 OrthancPluginChangeType changeType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
454 OrthancPluginResourceType resourceType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
455 const char* resourceId); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
456 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
457 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
458 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
459 /** |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
460 * @brief Signature of a function to free dynamic memory. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
461 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
462 typedef void (*OrthancPluginFree) (void* buffer); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
463 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
464 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
465 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
466 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
467 * @brief Callback for writing to the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
468 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
469 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
470 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
471 * @param uuid The UUID of the file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
472 * @param content The content of the file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
473 * @param size The size of the file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
474 * @param type The content type corresponding to this file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
475 * @return 0 if success, other value if error. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
476 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
477 typedef int32_t (*OrthancPluginStorageCreate) ( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
478 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
479 const void* content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
480 int64_t size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
481 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
482 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
483 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
484 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
485 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
486 * @brief Callback for reading from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
487 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
488 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
489 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
490 * @param content The content of the file (output). |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
491 * @param size The size of the file (output). |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
492 * @param uuid The UUID of the file of interest. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
493 * @param type The content type corresponding to this file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
494 * @return 0 if success, other value if error. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
495 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
496 typedef int32_t (*OrthancPluginStorageRead) ( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
497 void** content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
498 int64_t* size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
499 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
500 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
501 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
502 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
503 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
504 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
505 * @brief Callback for removing a file from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
506 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
507 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
508 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
509 * @param uuid The UUID of the file to be removed. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
510 * @param type The content type corresponding to this file. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
511 * @return 0 if success, other value if error. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
512 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
513 typedef int32_t (*OrthancPluginStorageRemove) ( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
514 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
515 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
516 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
517 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
518 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
519 /** |
907 | 520 * @brief Opaque structure that contains information about the Orthanc core. |
521 **/ | |
900 | 522 typedef struct _OrthancPluginContext_t |
523 { | |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
524 void* pluginsManager; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
525 const char* orthancVersion; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
526 OrthancPluginFree Free; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
527 int32_t (*InvokeService) (struct _OrthancPluginContext_t* context, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
528 _OrthancPluginService service, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
529 const void* params); |
899 | 530 } OrthancPluginContext; |
531 | |
886 | 532 |
907 | 533 |
534 /** | |
535 * @brief Free a string. | |
536 * | |
537 * Free a string that was allocated by the core system of Orthanc. | |
538 * | |
539 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
540 * @param str The string to be freed. | |
541 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
542 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
543 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
544 char* str) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
545 { |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
546 if (str != NULL) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
547 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
548 context->Free(str); |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
549 } |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
550 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
551 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
552 |
907 | 553 /** |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
554 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc. |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
555 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
556 * This function checks whether the version of this C header is |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
557 * compatible with the current version of Orthanc. The result of |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
558 * this function should always be checked in the |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
559 * OrthancPluginInitialize() entry point of the plugin. |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
560 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
561 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
562 * @return 1 if and only if the versions are compatible. If the |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
563 * result is 0, the initialization of the plugin should fail. |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
564 **/ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
565 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
566 OrthancPluginContext* context) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
567 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
568 int major, minor, revision; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
569 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
570 /* Assume compatibility with the mainline */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
571 if (!strcmp(context->orthancVersion, "mainline")) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
572 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
573 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
574 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
575 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
576 /* Parse the version of the Orthanc core */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
577 if ( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
578 #ifdef _MSC_VER |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
579 sscanf_s |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
580 #else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
581 sscanf |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
582 #endif |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
583 (context->orthancVersion, "%d.%d.%d", &major, &minor, &revision) != 3) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
584 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
585 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
586 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
587 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
588 /* Check the major number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
589 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
590 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
591 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
592 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
593 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
594 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
595 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
596 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
597 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
598 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
599 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
600 /* Check the minor number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
601 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
602 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
603 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
604 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
605 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
606 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
607 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
608 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
609 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
610 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
611 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
612 /* Check the revision number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
613 |
1040
d06186cdc502
check plugin version in samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1039
diff
changeset
|
614 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER) |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
615 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
616 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
617 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
618 else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
619 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
620 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
621 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
622 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
623 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
624 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
625 /** |
907 | 626 * @brief Free a memory buffer. |
627 * | |
628 * Free a memory buffer that was allocated by the core system of Orthanc. | |
629 * | |
630 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
631 * @param buffer The memory buffer to release. | |
632 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
633 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
634 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
635 OrthancPluginMemoryBuffer* buffer) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
636 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
637 context->Free(buffer->data); |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
638 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
639 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
640 |
907 | 641 /** |
642 * @brief Log an error. | |
643 * | |
644 * Log an error message using the Orthanc logging system. | |
645 * | |
646 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
647 * @param message The message to be logged. | |
648 **/ | |
900 | 649 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError( |
650 OrthancPluginContext* context, | |
907 | 651 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
652 { |
907 | 653 context->InvokeService(context, _OrthancPluginService_LogError, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
654 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
655 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
656 |
907 | 657 /** |
658 * @brief Log a warning. | |
659 * | |
660 * Log a warning message using the Orthanc logging system. | |
661 * | |
662 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
663 * @param message The message to be logged. | |
664 **/ | |
900 | 665 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning( |
666 OrthancPluginContext* context, | |
907 | 667 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
668 { |
907 | 669 context->InvokeService(context, _OrthancPluginService_LogWarning, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
670 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
671 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
672 |
907 | 673 /** |
674 * @brief Log an information. | |
675 * | |
676 * Log an information message using the Orthanc logging system. | |
677 * | |
678 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
679 * @param message The message to be logged. | |
680 **/ | |
900 | 681 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo( |
682 OrthancPluginContext* context, | |
907 | 683 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
684 { |
907 | 685 context->InvokeService(context, _OrthancPluginService_LogInfo, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
686 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
687 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
688 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
689 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
690 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
691 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
692 const char* pathRegularExpression; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
693 OrthancPluginRestCallback callback; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
694 } _OrthancPluginRestCallback; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
695 |
907 | 696 /** |
697 * @brief Register a REST callback. | |
698 * | |
699 * This function registers a REST callback against a regular | |
700 * expression for a URI. This function must be called during the | |
701 * initialization of the plugin, i.e. inside the | |
702 * OrthancPluginInitialize() public function. | |
703 * | |
704 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
705 * @param pathRegularExpression Regular expression for the URI. May contain groups. | |
706 * @param callback The callback function to handle the REST call. | |
707 **/ | |
900 | 708 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback( |
709 OrthancPluginContext* context, | |
710 const char* pathRegularExpression, | |
711 OrthancPluginRestCallback callback) | |
899 | 712 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
713 _OrthancPluginRestCallback params; |
899 | 714 params.pathRegularExpression = pathRegularExpression; |
715 params.callback = callback; | |
907 | 716 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, ¶ms); |
899 | 717 } |
718 | |
719 | |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
720 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
721 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
722 { |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
723 OrthancPluginOnStoredInstanceCallback callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
724 } _OrthancPluginOnStoredInstanceCallback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
725 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
726 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
727 * @brief Register a callback for received instances. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
728 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
729 * This function registers a callback function that is called |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
730 * whenever a new DICOM instance is stored into the Orthanc core. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
731 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
732 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
733 * @param callback The callback function. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
734 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
735 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
736 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
737 OrthancPluginOnStoredInstanceCallback callback) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
738 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
739 _OrthancPluginOnStoredInstanceCallback params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
740 params.callback = callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
741 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
742 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, ¶ms); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
743 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
744 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
745 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
746 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
747 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
748 { |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
749 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
750 const char* answer; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
751 uint32_t answerSize; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
752 const char* mimeType; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
753 } _OrthancPluginAnswerBuffer; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
754 |
907 | 755 /** |
756 * @brief Answer to a REST request. | |
757 * | |
758 * This function answers to a REST request with the content of a memory buffer. | |
759 * | |
760 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
761 * @param output The HTTP connection to the client application. | |
762 * @param answer Pointer to the memory buffer containing the answer. | |
763 * @param answerSize Number of bytes of the answer. | |
764 * @param mimeType The MIME type of the answer. | |
765 **/ | |
900 | 766 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer( |
767 OrthancPluginContext* context, | |
768 OrthancPluginRestOutput* output, | |
769 const char* answer, | |
770 uint32_t answerSize, | |
771 const char* mimeType) | |
899 | 772 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
773 _OrthancPluginAnswerBuffer params; |
899 | 774 params.output = output; |
775 params.answer = answer; | |
776 params.answerSize = answerSize; | |
777 params.mimeType = mimeType; | |
907 | 778 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, ¶ms); |
899 | 779 } |
780 | |
781 | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
782 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
783 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
784 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
785 OrthancPluginPixelFormat format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
786 uint32_t width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
787 uint32_t height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
788 uint32_t pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
789 const void* buffer; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
790 } _OrthancPluginCompressAndAnswerPngImage; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
791 |
907 | 792 /** |
793 * @brief Answer to a REST request with a PNG image. | |
794 * | |
795 * This function answers to a REST request with a PNG image. The | |
796 * parameters of this function describe a memory buffer that | |
797 * contains an uncompressed image. The image will be automatically compressed | |
798 * as a PNG image by the core system of Orthanc. | |
799 * | |
800 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
801 * @param output The HTTP connection to the client application. | |
802 * @param format The memory layout of the uncompressed image. | |
803 * @param width The width of the image. | |
804 * @param height The height of the image. | |
805 * @param pitch The pitch of the image (i.e. the number of bytes | |
806 * between 2 successive lines of the image in the memory buffer. | |
807 * @param buffer The memory buffer containing the uncompressed image. | |
808 **/ | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
809 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage( |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
810 OrthancPluginContext* context, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
811 OrthancPluginRestOutput* output, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
812 OrthancPluginPixelFormat format, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
813 uint32_t width, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
814 uint32_t height, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
815 uint32_t pitch, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
816 const void* buffer) |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
817 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
818 _OrthancPluginCompressAndAnswerPngImage params; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
819 params.output = output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
820 params.format = format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
821 params.width = width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
822 params.height = height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
823 params.pitch = pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
824 params.buffer = buffer; |
907 | 825 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerPngImage, ¶ms); |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
826 } |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
827 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
828 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
829 |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
830 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
831 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
832 OrthancPluginMemoryBuffer* target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
833 const char* instanceId; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
834 } _OrthancPluginGetDicomForInstance; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
835 |
907 | 836 /** |
837 * @brief Retrieve a DICOM instance using its Orthanc identifier. | |
838 * | |
839 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM | |
840 * file is stored into a newly allocated memory buffer. | |
841 * | |
842 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
843 * @param target The target memory buffer. | |
844 * @param instanceId The Orthanc identifier of the DICOM instance of interest. | |
845 * @return 0 if success, other value if error. | |
846 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
847 ORTHANC_PLUGIN_INLINE int OrthancPluginGetDicomForInstance( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
848 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
849 OrthancPluginMemoryBuffer* target, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
850 const char* instanceId) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
851 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
852 _OrthancPluginGetDicomForInstance params; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
853 params.target = target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
854 params.instanceId = instanceId; |
907 | 855 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, ¶ms); |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
856 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
857 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
858 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
859 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
860 typedef struct |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
861 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
862 OrthancPluginMemoryBuffer* target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
863 const char* uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
864 } _OrthancPluginRestApiGet; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
865 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
866 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
867 * @brief Make a GET call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
868 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
869 * Make a GET call to the built-in Orthanc REST API. The result to |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
870 * the query is stored into a newly allocated memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
871 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
872 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
873 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
874 * @param uri The URI in the built-in Orthanc API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
875 * @return 0 if success, other value if error. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
876 **/ |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
877 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiGet( |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
878 OrthancPluginContext* context, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
879 OrthancPluginMemoryBuffer* target, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
880 const char* uri) |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
881 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
882 _OrthancPluginRestApiGet params; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
883 params.target = target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
884 params.uri = uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
885 return context->InvokeService(context, _OrthancPluginService_RestApiGet, ¶ms); |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
886 } |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
887 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
888 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
889 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
890 typedef struct |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
891 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
892 OrthancPluginMemoryBuffer* target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
893 const char* uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
894 const char* body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
895 uint32_t bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
896 } _OrthancPluginRestApiPostPut; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
897 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
898 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
899 * @brief Make a POST call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
900 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
901 * Make a POST call to the built-in Orthanc REST API. The result to |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
902 * the query is stored into a newly allocated memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
903 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
904 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
905 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
906 * @param uri The URI in the built-in Orthanc API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
907 * @param body The body of the POST request. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
908 * @param bodySize The size of the body. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
909 * @return 0 if success, other value if error. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
910 **/ |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
911 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiPost( |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
912 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
913 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
914 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
915 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
916 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
917 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
918 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
919 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
920 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
921 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
922 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
923 return context->InvokeService(context, _OrthancPluginService_RestApiPost, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
924 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
925 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
926 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
927 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
928 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
929 * @brief Make a DELETE call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
930 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
931 * Make a DELETE call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
932 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
933 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
934 * @param uri The URI to delete in the built-in Orthanc API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
935 * @return 0 if success, other value if error. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
936 **/ |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
937 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiDelete( |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
938 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
939 const char* uri) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
940 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
941 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
942 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
943 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
944 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
945 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
946 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
947 * @brief Make a PUT call to the built-in Orthanc REST API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
948 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
949 * Make a PUT call to the built-in Orthanc REST API. The result to |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
950 * the query is stored into a newly allocated memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
951 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
952 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
953 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
954 * @param uri The URI in the built-in Orthanc API. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
955 * @param body The body of the PUT request. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
956 * @param bodySize The size of the body. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
957 * @return 0 if success, other value if error. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
958 **/ |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
959 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiPut( |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
960 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
961 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
962 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
963 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
964 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
965 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
966 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
967 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
968 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
969 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
970 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
971 return context->InvokeService(context, _OrthancPluginService_RestApiPut, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
972 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
973 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
974 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
975 |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
976 typedef struct |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
977 { |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
978 OrthancPluginRestOutput* output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
979 const char* argument; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
980 } _OrthancPluginOutputPlusArgument; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
981 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
982 /** |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
983 * @brief Redirect a REST request. |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
984 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
985 * This function answers to a REST request by redirecting the user |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
986 * to another URI using HTTP status 301. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
987 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
988 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
989 * @param output The HTTP connection to the client application. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
990 * @param redirection Where to redirect. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
991 **/ |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
992 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect( |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
993 OrthancPluginContext* context, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
994 OrthancPluginRestOutput* output, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
995 const char* redirection) |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
996 { |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
997 _OrthancPluginOutputPlusArgument params; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
998 params.output = output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
999 params.argument = redirection; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1000 context->InvokeService(context, _OrthancPluginService_Redirect, ¶ms); |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1001 } |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1002 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1003 |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1004 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1005 typedef struct |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1006 { |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1007 char** result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1008 const char* argument; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1009 } _OrthancPluginRetrieveDynamicString; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1010 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1011 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1012 * @brief Look for a patient. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1013 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1014 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1015 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1016 * over all the stored patients). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1017 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1018 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1019 * @param patientID The Patient ID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1020 * @return The NULL value if the patient is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1021 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1022 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1023 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1024 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1025 const char* patientID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1026 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1027 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1028 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1029 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1030 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1031 params.argument = patientID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1032 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1033 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1034 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1035 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1036 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1037 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1038 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1039 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1040 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1041 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1042 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1043 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1044 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1045 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1046 * @brief Look for a study. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1047 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1048 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1049 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1050 * over all the stored studies). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1051 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1052 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1053 * @param studyUID The Study Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1054 * @return The NULL value if the study is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1055 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1056 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1057 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1058 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1059 const char* studyUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1060 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1061 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1062 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1063 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1064 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1065 params.argument = studyUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1066 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1067 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1068 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1069 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1070 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1071 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1072 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1073 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1074 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1075 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1076 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1077 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1078 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1079 /** |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1080 * @brief Look for a study, using the accession number. |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1081 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1082 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1083 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1084 * over all the stored studies). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1085 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1086 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1087 * @param accessionNumber The Accession Number of interest. |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1088 * @return The NULL value if the study is non-existent, or a string containing the |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1089 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1090 **/ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1091 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber( |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1092 OrthancPluginContext* context, |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1093 const char* accessionNumber) |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1094 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1095 char* result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1096 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1097 _OrthancPluginRetrieveDynamicString params; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1098 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1099 params.argument = accessionNumber; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1100 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1101 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, ¶ms)) |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1102 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1103 /* Error */ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1104 return NULL; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1105 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1106 else |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1107 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1108 return result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1109 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1110 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1111 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1112 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1113 /** |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1114 * @brief Look for a series. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1115 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1116 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1117 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1118 * over all the stored series). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1119 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1120 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1121 * @param seriesUID The Series Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1122 * @return The NULL value if the series is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1123 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1124 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1125 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1126 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1127 const char* seriesUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1128 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1129 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1130 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1131 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1132 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1133 params.argument = seriesUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1134 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1135 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1136 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1137 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1138 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1139 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1140 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1141 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1142 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1143 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1144 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1145 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1146 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1147 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1148 * @brief Look for an instance. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1149 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1150 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018). |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1151 * This function uses the database index to run as fast as possible (it does not loop |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1152 * over all the stored instances). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1153 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1154 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1155 * @param sopInstanceUID The SOP Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1156 * @return The NULL value if the instance is non-existent, or a string containing the |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1157 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString(). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1158 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1159 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1160 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1161 const char* sopInstanceUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1162 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1163 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1164 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1165 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1166 params.result = &result; |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1167 params.argument = sopInstanceUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1168 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1169 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1170 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1171 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1172 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1173 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1174 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1175 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1176 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1177 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1178 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1179 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1180 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1181 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1182 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1183 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1184 OrthancPluginRestOutput* output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1185 uint16_t status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1186 } _OrthancPluginSendHttpStatusCode; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1187 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1188 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1189 * @brief Send a HTTP status code. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1190 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1191 * This function answers to a REST request by sending a HTTP status |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1192 * code (such as "400 - Bad Request"). Note that: |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1193 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1194 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1195 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1196 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1197 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1198 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1199 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1200 * @param status The HTTP status code to be sent. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1201 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1202 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1203 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1204 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1205 uint16_t status) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1206 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1207 _OrthancPluginSendHttpStatusCode params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1208 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1209 params.status = status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1210 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1211 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1212 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1213 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1214 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1215 * @brief Signal that a REST request is not authorized. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1216 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1217 * This function answers to a REST request by signaling that it is |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1218 * not authorized. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1219 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1220 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1221 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1222 * @param realm The realm for the authorization process. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1223 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1224 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1225 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1226 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1227 const char* realm) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1228 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1229 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1230 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1231 params.argument = realm; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1232 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1233 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1234 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1235 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1236 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1237 * @brief Signal that this URI does not support this HTTP method. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1238 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1239 * This function answers to a REST request by signaling that the |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1240 * queried URI does not support this method. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1241 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1242 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1243 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1244 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1245 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1246 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1247 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1248 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1249 const char* allowedMethods) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1250 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1251 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1252 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1253 params.argument = allowedMethods; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1254 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1255 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1256 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1257 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1258 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1259 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1260 OrthancPluginRestOutput* output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1261 const char* key; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1262 const char* value; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1263 } _OrthancPluginSetHttpHeader; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1264 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1265 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1266 * @brief Set a cookie. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1267 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1268 * This function sets a cookie in the HTTP client. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1269 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1270 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1271 * @param output The HTTP connection to the client application. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1272 * @param cookie The cookie to be set. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1273 * @param value The value of the cookie. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1274 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1275 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1276 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1277 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1278 const char* cookie, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1279 const char* value) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1280 { |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1281 _OrthancPluginSetHttpHeader params; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1282 params.output = output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1283 params.key = cookie; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1284 params.value = value; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1285 context->InvokeService(context, _OrthancPluginService_SetCookie, ¶ms); |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1286 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1287 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1288 |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1289 /** |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1290 * @brief Set some HTTP header. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1291 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1292 * This function sets a HTTP header in the HTTP answer. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1293 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1294 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1295 * @param output The HTTP connection to the client application. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1296 * @param key The HTTP header to be set. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1297 * @param value The value of the HTTP header. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1298 **/ |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1299 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader( |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1300 OrthancPluginContext* context, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1301 OrthancPluginRestOutput* output, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1302 const char* key, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1303 const char* value) |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1304 { |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1305 _OrthancPluginSetHttpHeader params; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1306 params.output = output; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1307 params.key = key; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1308 params.value = value; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1309 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, ¶ms); |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1310 } |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1311 |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1312 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1313 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1314 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1315 char** resultStringToFree; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1316 const char** resultString; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1317 int64_t* resultInt64; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1318 const char* key; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1319 OrthancPluginDicomInstance* instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1320 } _OrthancPluginAccessDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1321 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1322 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1323 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1324 * @brief Get the AET of a DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1325 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1326 * This function returns the Application Entity Title (AET) of the |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1327 * DICOM modality from which a DICOM instance originates. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1328 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1329 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1330 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1331 * @return The AET if success, NULL if error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1332 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1333 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1334 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1335 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1336 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1337 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1338 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1339 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1340 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1341 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1342 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1343 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1344 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1345 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1346 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1347 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1348 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1349 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1350 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1351 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1352 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1353 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1354 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1355 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1356 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1357 * @brief Get the size of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1358 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1359 * This function returns the number of bytes of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1360 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1361 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1362 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1363 * @return The size of the file, -1 in case of error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1364 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1365 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1366 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1367 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1368 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1369 int64_t size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1370 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1371 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1372 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1373 params.resultInt64 = &size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1374 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1375 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1376 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1377 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1378 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1379 return -1; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1380 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1381 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1382 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1383 return size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1384 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1385 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1386 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1387 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1388 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1389 * @brief Get the data of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1390 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1391 * This function returns a pointer to the content of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1392 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1393 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1394 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1395 * @return The pointer to the DICOM data, NULL in case of error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1396 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1397 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1398 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1399 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1400 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1401 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1402 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1403 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1404 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1405 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1406 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1407 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1408 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1409 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1410 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1411 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1412 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1413 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1414 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1415 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1416 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1417 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1418 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1419 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1420 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1421 * @brief Get the DICOM tag hierarchy as a JSON file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1422 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1423 * This function returns a pointer to a newly created string |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1424 * containing a JSON file. This JSON file encodes the tag hierarchy |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1425 * of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1426 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1427 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1428 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1429 * @return The NULL value in case of error, or a string containing the JSON file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1430 * This string must be freed by OrthancPluginFreeString(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1431 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1432 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1433 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1434 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1435 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1436 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1437 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1438 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1439 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1440 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1441 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1442 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1443 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1444 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1445 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1446 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1447 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1448 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1449 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1450 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1451 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1452 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1453 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1454 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1455 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1456 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1457 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1458 * This function returns a pointer to a newly created string |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1459 * containing a JSON file. This JSON file encodes the tag hierarchy |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1460 * of the given DICOM instance. In contrast with |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1461 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1462 * its simplified version. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1463 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1464 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1465 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1466 * @return The NULL value in case of error, or a string containing the JSON file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1467 * This string must be freed by OrthancPluginFreeString(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1468 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1469 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1470 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1471 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1472 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1473 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1474 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1475 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1476 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1477 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1478 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1479 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1480 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, ¶ms)) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1481 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1482 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1483 return NULL; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1484 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1485 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1486 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1487 return result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1488 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1489 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1490 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1491 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1492 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1493 * @brief Check whether a DICOM instance is associated with some metadata. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1494 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1495 * This function checks whether the DICOM instance of interest is |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1496 * associated with some metadata. As of Orthanc 0.8.1, in the |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1497 * callbacks registered by |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1498 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1499 * possibly available metadata are "ReceptionDate", "RemoteAET" and |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1500 * "IndexInSeries". |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1501 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1502 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1503 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1504 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1505 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1506 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1507 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1508 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1509 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1510 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1511 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1512 int64_t result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1513 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1514 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1515 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1516 params.resultInt64 = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1517 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1518 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1519 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1520 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, ¶ms)) |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1521 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1522 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1523 return -1; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1524 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1525 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1526 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1527 return (result != 0); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1528 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1529 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1530 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1531 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1532 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1533 * @brief Get the value of some metadata associated with a given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1534 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1535 * This functions returns the value of some metadata that is associated with the DICOM instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1536 * Before calling this function, the existence of the metadata must have been checked with |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1537 * ::OrthancPluginHasInstanceMetadata(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1538 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1539 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1540 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1541 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1542 * @return The metadata value if success, NULL if error. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1543 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1544 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1545 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1546 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1547 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1548 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1549 const char* result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1550 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1551 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1552 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1553 params.resultString = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1554 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1555 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1556 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1557 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, ¶ms)) |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1558 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1559 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1560 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1561 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1562 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1563 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1564 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1565 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1566 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1567 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1568 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1569 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1570 typedef struct |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1571 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1572 OrthancPluginStorageCreate create_; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1573 OrthancPluginStorageRead read_; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1574 OrthancPluginStorageRemove remove_; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1575 OrthancPluginFree free_; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1576 } _OrthancPluginRegisterStorageArea; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1577 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1578 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1579 * @brief Register a custom storage area. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1580 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1581 * This function registers a custom storage area, to replace the |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1582 * built-in way Orthanc stores its files on the filesystem. This |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1583 * function must be called during the initialization of the plugin, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1584 * i.e. inside the OrthancPluginInitialize() public function. |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1585 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1586 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1141 | 1587 * @param create The callback function to store a file on the custom storage area. |
1588 * @param read The callback function to read a file from the custom storage area. | |
1589 * @param remove The callback function to remove a file from the custom storage area. | |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1590 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1591 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea( |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1592 OrthancPluginContext* context, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1593 OrthancPluginStorageCreate create, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1594 OrthancPluginStorageRead read, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1595 OrthancPluginStorageRemove remove) |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1596 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1597 _OrthancPluginRegisterStorageArea params; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1598 params.create_ = create; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1599 params.read_ = read; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1600 params.remove_ = remove; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1601 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1602 #ifdef __cplusplus |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1603 params.free_ = ::free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1604 #else |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1605 params.free_ = free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1606 #endif |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
1607 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1608 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, ¶ms); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1609 } |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1610 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
1611 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1612 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1613 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1614 * @brief Return the path to the Orthanc executable. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1615 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1616 * This function returns the path to the Orthanc executable. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1617 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1618 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1619 * @return NULL in the case of an error, or a newly allocated string |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1620 * containing the path. This string must be freed by |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1621 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1622 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1623 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1624 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1625 char* result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1626 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1627 _OrthancPluginRetrieveDynamicString params; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1628 params.result = &result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1629 params.argument = NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1630 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1631 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, ¶ms)) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1632 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1633 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1634 return NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1635 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1636 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1637 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1638 return result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1639 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1640 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1641 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1642 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1643 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1644 * @brief Return the directory containing the Orthanc. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1645 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1646 * This function returns the path to the directory containing the Orthanc executable. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1647 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1648 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1649 * @return NULL in the case of an error, or a newly allocated string |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1650 * containing the path. This string must be freed by |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1651 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1652 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1653 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1654 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1655 char* result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1656 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1657 _OrthancPluginRetrieveDynamicString params; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1658 params.result = &result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1659 params.argument = NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1660 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1661 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, ¶ms)) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1662 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1663 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1664 return NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1665 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1666 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1667 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1668 return result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1669 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1670 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1671 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1672 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1673 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1674 * @brief Return the path to the configuration file. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1675 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1676 * This function returns the path to the configuration file that was |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1677 * specified when starting Orthanc. |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1678 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1679 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1680 * @return NULL in the case of an error, or a newly allocated string |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1681 * containing the path. This string must be freed by |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1682 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1683 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1684 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1685 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1686 char* result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1687 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1688 _OrthancPluginRetrieveDynamicString params; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1689 params.result = &result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1690 params.argument = NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1691 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1692 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, ¶ms)) |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1693 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1694 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1695 return NULL; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1696 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1697 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1698 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1699 return result; |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1700 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1701 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1702 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1703 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1704 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1705 typedef struct |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1706 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1707 OrthancPluginOnChangeCallback callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1708 } _OrthancPluginOnChangeCallback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1709 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1710 /** |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1711 * @brief Register a callback to monitor changes. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1712 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1713 * This function registers a callback function that is called |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1714 * whenever a change happens to some DICOM resource. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1715 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1716 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1717 * @param callback The callback function. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1718 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1719 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback( |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1720 OrthancPluginContext* context, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1721 OrthancPluginOnChangeCallback callback) |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1722 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1723 _OrthancPluginOnChangeCallback params; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1724 params.callback = callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1725 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1726 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, ¶ms); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1727 } |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1728 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1729 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1730 |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1731 typedef struct |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1732 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1733 const char* plugin; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1734 _OrthancPluginProperty property; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1735 const char* value; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1736 } _OrthancPluginSetProperty; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1737 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1738 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1739 /** |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1740 * @brief Set the URI where the plugin provides its Web interface. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1741 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1742 * For plugins that come with a Web interface, this function |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1743 * declares the entry path where to find this interface. This |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1744 * information is notably used in the "Plugins" page of Orthanc |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1745 * Explorer. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1746 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1747 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1748 * @param uri The root URI for this plugin. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1749 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1750 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri( |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1751 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1752 const char* uri) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1753 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1754 _OrthancPluginSetProperty params; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1755 params.plugin = OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1756 params.property = _OrthancPluginProperty_RootUri; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1757 params.value = uri; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1758 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1759 context->InvokeService(context, _OrthancPluginService_SetProperty, ¶ms); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1760 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1761 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1762 |
1233 | 1763 /** |
1764 * @brief Set a description for this plugin. | |
1765 * | |
1766 * Set a description for this plugin. It is displayed in the | |
1767 * "Plugins" page of Orthanc Explorer. | |
1768 * | |
1769 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1770 * @param description The description. | |
1771 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1772 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription( |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1773 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1774 const char* description) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1775 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1776 _OrthancPluginSetProperty params; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1777 params.plugin = OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1778 params.property = _OrthancPluginProperty_Description; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1779 params.value = description; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1780 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1781 context->InvokeService(context, _OrthancPluginService_SetProperty, ¶ms); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1782 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1783 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1784 |
1233 | 1785 /** |
1786 * @brief Extend the JavaScript code of Orthanc Explorer. | |
1787 * | |
1788 * Add JavaScript code to customize the default behavior of Orthanc | |
1789 * Explorer. This can for instance be used to add new buttons. | |
1790 * | |
1791 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1792 * @param javascript The custom JavaScript code. | |
1793 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1794 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer( |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1795 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1796 const char* javascript) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1797 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1798 _OrthancPluginSetProperty params; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1799 params.plugin = OrthancPluginGetName(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1800 params.property = _OrthancPluginProperty_OrthancExplorer; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1801 params.value = javascript; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1802 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1803 context->InvokeService(context, _OrthancPluginService_SetProperty, ¶ms); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
1804 } |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
1805 |
886 | 1806 #ifdef __cplusplus |
1807 } | |
1808 #endif | |
900 | 1809 |
1810 | |
1811 /** @} */ | |
1812 |