Mercurial > hg > orthanc
annotate Plugins/OrthancCPlugin/OrthancCPlugin.h @ 1038:a53dc58edc5a
news
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 16 Jul 2014 16:51:26 +0200 |
parents | 6208ab500ffd |
children | 5a5a4890ffca |
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. | |
11 * The plugin must store the context pointer so that it can use the plugin | |
12 * services of Orthanc. It must also register all its callbacks using | |
13 * ::OrthancPluginRegisterRestCallback(). | |
14 * -# <tt>void OrthancPluginFinalize()</tt>: | |
15 * This function is invoked by Orthanc during its shutdown. The plugin | |
16 * must free all its memory. | |
17 * -# <tt>const char* OrthancPluginGetName()</tt>: | |
18 * The plugin must return a short string to identify itself. | |
19 * -# <tt>const char* OrthancPluginGetVersion()</tt> | |
20 * The plugin must return a string containing its version number. | |
21 * | |
22 * The name and the version of a plugin is only used to prevent it | |
23 * from being loaded twice. | |
24 * | |
25 * | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
26 **/ |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
27 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
28 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
29 |
900 | 30 /** |
31 * @defgroup CInterface C Interface | |
32 * @brief The C interface to create Orthanc plugins. | |
33 * | |
34 * These functions must be used to create C plugins for Orthanc. | |
35 **/ | |
36 | |
37 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
38 |
886 | 39 /** |
40 * Orthanc - A Lightweight, RESTful DICOM Store | |
41 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, | |
42 * Belgium | |
43 * | |
44 * This program is free software: you can redistribute it and/or | |
45 * modify it under the terms of the GNU General Public License as | |
46 * published by the Free Software Foundation, either version 3 of the | |
47 * License, or (at your option) any later version. | |
48 * | |
49 * In addition, as a special exception, the copyright holders of this | |
50 * program give permission to link the code of its release with the | |
51 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
52 * that use the same license as the "OpenSSL" library), and distribute | |
53 * the linked executables. You must obey the GNU General Public License | |
54 * in all respects for all of the code used other than "OpenSSL". If you | |
55 * modify file(s) with this exception, you may extend this exception to | |
56 * your version of the file(s), but you are not obligated to do so. If | |
57 * you do not wish to do so, delete this exception statement from your | |
58 * version. If you delete this exception statement from all source files | |
59 * in the program, then also delete it here. | |
60 * | |
61 * This program is distributed in the hope that it will be useful, but | |
62 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
63 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
64 * General Public License for more details. | |
65 * | |
66 * You should have received a copy of the GNU General Public License | |
67 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
68 **/ | |
69 | |
70 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
71 |
886 | 72 #pragma once |
73 | |
74 | |
900 | 75 #include <stdio.h> |
76 #include <string.h> | |
77 | |
886 | 78 #ifdef WIN32 |
79 #define ORTHANC_PLUGINS_API __declspec(dllexport) | |
80 #else | |
81 #define ORTHANC_PLUGINS_API | |
82 #endif | |
83 | |
84 | |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
85 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
86 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
87 ** Check that function inlining is properly supported. The use of |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
88 ** inlining is required, to avoid the duplication of object code |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
89 ** between two compilation modules that would use the Orthanc Plugin |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
90 ** API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
91 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
92 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
93 /* 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
|
94 automatically and that your compiler is known to properly support |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
95 inlining, uncomment the following #define and adapt the definition |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
96 of "static inline". */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
97 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
98 /* #define ORTHANC_PLUGIN_INLINE static inline */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
99 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
100 #ifndef ORTHANC_PLUGIN_INLINE |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
101 # if __STDC_VERSION__ >= 199901L |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
102 /* 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
|
103 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
104 # elif defined(__cplusplus) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
105 /* This is C++ */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
106 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
107 # elif defined(__GNUC__) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
108 /* This is GCC running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
109 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
110 # elif defined(_MSC_VER) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
111 /* This is Visual Studio running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
112 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
113 # else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
114 # 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
|
115 # endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
116 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
117 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
118 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
119 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
120 /******************************************************************** |
907 | 121 ** Inclusion of standard libraries. |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
122 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
123 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
124 #ifdef _MSC_VER |
1027 | 125 #include "../../Resources/ThirdParty/VisualStudio/stdint.h" |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
126 #else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
127 #include <stdint.h> |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
128 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
129 |
886 | 130 #include <stdlib.h> |
131 | |
132 | |
898
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 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
135 ** Definition of the Orthanc Plugin API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
136 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
137 |
900 | 138 /** @{ */ |
139 | |
886 | 140 #ifdef __cplusplus |
141 extern "C" | |
142 { | |
143 #endif | |
144 | |
907 | 145 /** |
146 * The various HTTP methods for a REST call. | |
147 **/ | |
894 | 148 typedef enum |
149 { | |
907 | 150 OrthancPluginHttpMethod_Get = 1, /*!< GET request */ |
151 OrthancPluginHttpMethod_Post = 2, /*!< POST request */ | |
152 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */ | |
153 OrthancPluginHttpMethod_Delete = 4 /*!< DELETE request */ | |
896 | 154 } OrthancPluginHttpMethod; |
886 | 155 |
907 | 156 |
157 /** | |
158 * @brief The parameters of a REST request. | |
159 **/ | |
899 | 160 typedef struct |
161 { | |
907 | 162 /** |
163 * @brief The HTTP method. | |
164 **/ | |
165 OrthancPluginHttpMethod method; | |
899 | 166 |
907 | 167 /** |
168 * @brief The number of groups of the regular expression. | |
169 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
170 uint32_t groupsCount; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
171 |
907 | 172 /** |
173 * @brief The matched values for the groups of the regular expression. | |
174 **/ | |
175 const char* const* groups; | |
176 | |
177 /** | |
178 * @brief For a GET request, the number of GET parameters. | |
179 **/ | |
899 | 180 uint32_t getCount; |
181 | |
907 | 182 /** |
183 * @brief For a GET request, the keys of the GET parameters. | |
184 **/ | |
185 const char* const* getKeys; | |
186 | |
187 /** | |
188 * @brief For a GET request, the values of the GET parameters. | |
189 **/ | |
190 const char* const* getValues; | |
191 | |
192 /** | |
193 * @brief For a PUT or POST request, the content of the body. | |
194 **/ | |
899 | 195 const char* body; |
907 | 196 |
197 /** | |
198 * @brief For a PUT or POST request, the number of bytes of the body. | |
199 **/ | |
899 | 200 uint32_t bodySize; |
201 } OrthancPluginHttpRequest; | |
202 | |
900 | 203 typedef enum |
886 | 204 { |
900 | 205 /* Generic services */ |
907 | 206 _OrthancPluginService_LogInfo = 1, |
207 _OrthancPluginService_LogWarning = 2, | |
208 _OrthancPluginService_LogError = 3, | |
900 | 209 |
210 /* Registration of callbacks */ | |
907 | 211 _OrthancPluginService_RegisterRestCallback = 1000, |
900 | 212 |
213 /* Sending answers to REST calls */ | |
907 | 214 _OrthancPluginService_AnswerBuffer = 2000, |
215 _OrthancPluginService_CompressAndAnswerPngImage = 2001, | |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
216 _OrthancPluginService_Redirect = 2002, |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
217 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
218 /* Access to the Orthanc database and API */ |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
219 _OrthancPluginService_GetDicomForInstance = 3000, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
220 _OrthancPluginService_RestApiGet = 3001, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
221 _OrthancPluginService_RestApiPost = 3002, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
222 _OrthancPluginService_RestApiDelete = 3003, |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
223 _OrthancPluginService_RestApiPut = 3004, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
224 _OrthancPluginService_LookupPatient = 3005, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
225 _OrthancPluginService_LookupStudy = 3006, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
226 _OrthancPluginService_LookupSeries = 3007, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
227 _OrthancPluginService_LookupInstance = 3008 |
907 | 228 } _OrthancPluginService; |
900 | 229 |
230 | |
231 | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
232 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
233 * 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
|
234 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
235 typedef enum |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
236 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
237 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
238 * @brief Graylevel 8bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
239 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
240 * 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
|
241 * one byte. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
242 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
243 OrthancPluginPixelFormat_Grayscale8 = 1, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
244 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
245 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
246 * @brief Graylevel, unsigned 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
247 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
248 * 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
|
249 * two bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
250 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
251 OrthancPluginPixelFormat_Grayscale16 = 2, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
252 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
253 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
254 * @brief Graylevel, signed 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
255 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
256 * 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
|
257 * bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
258 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
259 OrthancPluginPixelFormat_SignedGrayscale16 = 3, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
260 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
261 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
262 * @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
|
263 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
264 * 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
|
265 * 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
|
266 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
267 OrthancPluginPixelFormat_RGB24 = 4, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
268 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
269 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
270 * @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
|
271 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
272 * 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
|
273 * 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
|
274 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
275 OrthancPluginPixelFormat_RGBA32 = 5 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
276 } OrthancPluginPixelFormat; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
277 |
894 | 278 |
907 | 279 /** |
280 * @brief A memory buffer allocated by the core system of Orthanc. | |
281 * | |
282 * A memory buffer allocated by the core system of Orthanc. When the | |
283 * content of the buffer is not useful anymore, it must be free by a | |
284 * call to ::OrthancPluginFreeMemoryBuffer(). | |
285 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
286 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
287 { |
907 | 288 /** |
289 * @brief The content of the buffer. | |
290 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
291 void* data; |
907 | 292 |
293 /** | |
294 * @brief The number of bytes in the buffer. | |
295 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
296 uint32_t size; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
297 } OrthancPluginMemoryBuffer; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
298 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
299 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
300 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
301 |
907 | 302 /** |
303 * @brief Opaque structure that represents the HTTP connection to the client application. | |
304 **/ | |
900 | 305 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput; |
306 | |
907 | 307 |
308 /** | |
908
e078ea944089
refactoring HttpOutput
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
907
diff
changeset
|
309 * @brief Signature of a callback function that answers to a REST request. |
907 | 310 **/ |
900 | 311 typedef int32_t (*OrthancPluginRestCallback) ( |
312 OrthancPluginRestOutput* output, | |
313 const char* url, | |
314 const OrthancPluginHttpRequest* request); | |
315 | |
907 | 316 |
317 /** | |
318 * @brief Opaque structure that contains information about the Orthanc core. | |
319 **/ | |
900 | 320 typedef struct _OrthancPluginContext_t |
321 { | |
322 void* pluginsManager; | |
323 const char* orthancVersion; | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
324 void (*Free) (void* buffer); |
900 | 325 int32_t (*InvokeService) (struct _OrthancPluginContext_t* context, |
907 | 326 _OrthancPluginService service, |
900 | 327 const void* params); |
899 | 328 } OrthancPluginContext; |
329 | |
886 | 330 |
907 | 331 |
332 /** | |
333 * @brief Free a string. | |
334 * | |
335 * Free a string that was allocated by the core system of Orthanc. | |
336 * | |
337 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
338 * @param str The string to be freed. | |
339 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
340 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
341 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
342 char* str) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
343 { |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
344 if (str != NULL) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
345 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
346 context->Free(str); |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
347 } |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
348 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
349 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
350 |
907 | 351 /** |
352 * @brief Free a memory buffer. | |
353 * | |
354 * Free a memory buffer that was allocated by the core system of Orthanc. | |
355 * | |
356 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
357 * @param buffer The memory buffer to release. | |
358 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
359 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
360 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
361 OrthancPluginMemoryBuffer* buffer) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
362 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
363 context->Free(buffer->data); |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
364 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
365 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
366 |
907 | 367 /** |
368 * @brief Log an error. | |
369 * | |
370 * Log an error message using the Orthanc logging system. | |
371 * | |
372 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
373 * @param message The message to be logged. | |
374 **/ | |
900 | 375 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError( |
376 OrthancPluginContext* context, | |
907 | 377 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
378 { |
907 | 379 context->InvokeService(context, _OrthancPluginService_LogError, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
380 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
381 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
382 |
907 | 383 /** |
384 * @brief Log a warning. | |
385 * | |
386 * Log a warning message using the Orthanc logging system. | |
387 * | |
388 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
389 * @param message The message to be logged. | |
390 **/ | |
900 | 391 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning( |
392 OrthancPluginContext* context, | |
907 | 393 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
394 { |
907 | 395 context->InvokeService(context, _OrthancPluginService_LogWarning, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
396 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
397 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
398 |
907 | 399 /** |
400 * @brief Log an information. | |
401 * | |
402 * Log an information message using the Orthanc logging system. | |
403 * | |
404 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
405 * @param message The message to be logged. | |
406 **/ | |
900 | 407 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo( |
408 OrthancPluginContext* context, | |
907 | 409 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
410 { |
907 | 411 context->InvokeService(context, _OrthancPluginService_LogInfo, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
412 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
413 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
414 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
415 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
416 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
417 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
418 const char* pathRegularExpression; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
419 OrthancPluginRestCallback callback; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
420 } _OrthancPluginRestCallback; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
421 |
907 | 422 /** |
423 * @brief Register a REST callback. | |
424 * | |
425 * This function registers a REST callback against a regular | |
426 * expression for a URI. This function must be called during the | |
427 * initialization of the plugin, i.e. inside the | |
428 * OrthancPluginInitialize() public function. | |
429 * | |
430 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
431 * @param pathRegularExpression Regular expression for the URI. May contain groups. | |
432 * @param callback The callback function to handle the REST call. | |
433 **/ | |
900 | 434 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback( |
435 OrthancPluginContext* context, | |
436 const char* pathRegularExpression, | |
437 OrthancPluginRestCallback callback) | |
899 | 438 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
439 _OrthancPluginRestCallback params; |
899 | 440 params.pathRegularExpression = pathRegularExpression; |
441 params.callback = callback; | |
907 | 442 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, ¶ms); |
899 | 443 } |
444 | |
445 | |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
446 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
447 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
448 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
449 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
450 const char* answer; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
451 uint32_t answerSize; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
452 const char* mimeType; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
453 } _OrthancPluginAnswerBuffer; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
454 |
907 | 455 /** |
456 * @brief Answer to a REST request. | |
457 * | |
458 * This function answers to a REST request with the content of a memory buffer. | |
459 * | |
460 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
461 * @param output The HTTP connection to the client application. | |
462 * @param answer Pointer to the memory buffer containing the answer. | |
463 * @param answerSize Number of bytes of the answer. | |
464 * @param mimeType The MIME type of the answer. | |
465 **/ | |
900 | 466 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer( |
467 OrthancPluginContext* context, | |
468 OrthancPluginRestOutput* output, | |
469 const char* answer, | |
470 uint32_t answerSize, | |
471 const char* mimeType) | |
899 | 472 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
473 _OrthancPluginAnswerBuffer params; |
899 | 474 params.output = output; |
475 params.answer = answer; | |
476 params.answerSize = answerSize; | |
477 params.mimeType = mimeType; | |
907 | 478 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, ¶ms); |
899 | 479 } |
480 | |
481 | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
482 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
483 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
484 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
485 OrthancPluginPixelFormat format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
486 uint32_t width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
487 uint32_t height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
488 uint32_t pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
489 const void* buffer; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
490 } _OrthancPluginCompressAndAnswerPngImage; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
491 |
907 | 492 /** |
493 * @brief Answer to a REST request with a PNG image. | |
494 * | |
495 * This function answers to a REST request with a PNG image. The | |
496 * parameters of this function describe a memory buffer that | |
497 * contains an uncompressed image. The image will be automatically compressed | |
498 * as a PNG image by the core system of Orthanc. | |
499 * | |
500 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
501 * @param output The HTTP connection to the client application. | |
502 * @param format The memory layout of the uncompressed image. | |
503 * @param width The width of the image. | |
504 * @param height The height of the image. | |
505 * @param pitch The pitch of the image (i.e. the number of bytes | |
506 * between 2 successive lines of the image in the memory buffer. | |
507 * @param buffer The memory buffer containing the uncompressed image. | |
508 **/ | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
509 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage( |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
510 OrthancPluginContext* context, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
511 OrthancPluginRestOutput* output, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
512 OrthancPluginPixelFormat format, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
513 uint32_t width, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
514 uint32_t height, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
515 uint32_t pitch, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
516 const void* buffer) |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
517 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
518 _OrthancPluginCompressAndAnswerPngImage params; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
519 params.output = output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
520 params.format = format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
521 params.width = width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
522 params.height = height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
523 params.pitch = pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
524 params.buffer = buffer; |
907 | 525 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
|
526 } |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
527 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
528 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
529 |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
530 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
531 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
532 OrthancPluginMemoryBuffer* target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
533 const char* instanceId; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
534 } _OrthancPluginGetDicomForInstance; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
535 |
907 | 536 /** |
537 * @brief Retrieve a DICOM instance using its Orthanc identifier. | |
538 * | |
539 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM | |
540 * file is stored into a newly allocated memory buffer. | |
541 * | |
542 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
543 * @param target The target memory buffer. | |
544 * @param instanceId The Orthanc identifier of the DICOM instance of interest. | |
545 * @return 0 if success, other value if error. | |
546 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
547 ORTHANC_PLUGIN_INLINE int OrthancPluginGetDicomForInstance( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
548 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
549 OrthancPluginMemoryBuffer* target, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
550 const char* instanceId) |
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 _OrthancPluginGetDicomForInstance params; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
553 params.target = target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
554 params.instanceId = instanceId; |
907 | 555 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, ¶ms); |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
556 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
557 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
558 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
559 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
560 typedef struct |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
561 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
562 OrthancPluginMemoryBuffer* target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
563 const char* uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
564 } _OrthancPluginRestApiGet; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
565 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
566 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
567 * @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
|
568 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
569 * 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
|
570 * 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
|
571 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
572 * @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
|
573 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
574 * @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
|
575 * @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
|
576 **/ |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
577 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiGet( |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
578 OrthancPluginContext* context, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
579 OrthancPluginMemoryBuffer* target, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
580 const char* uri) |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
581 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
582 _OrthancPluginRestApiGet params; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
583 params.target = target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
584 params.uri = uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
585 return context->InvokeService(context, _OrthancPluginService_RestApiGet, ¶ms); |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
586 } |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
587 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
588 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
589 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
590 typedef struct |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
591 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
592 OrthancPluginMemoryBuffer* target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
593 const char* uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
594 const char* body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
595 uint32_t bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
596 } _OrthancPluginRestApiPostPut; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
597 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
598 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
599 * @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
|
600 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
601 * 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
|
602 * 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
|
603 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
604 * @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
|
605 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
606 * @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
|
607 * @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
|
608 * @param bodySize The size of the body. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
609 * @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
|
610 **/ |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
611 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiPost( |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
612 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
613 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
614 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
615 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
616 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
617 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
618 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
619 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
620 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
621 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
622 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
623 return context->InvokeService(context, _OrthancPluginService_RestApiPost, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
624 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
625 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
626 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
627 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
628 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
629 * @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
|
630 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
631 * 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
|
632 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
633 * @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
|
634 * @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
|
635 * @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
|
636 **/ |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
637 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiDelete( |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
638 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
639 const char* uri) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
640 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
641 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
642 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
643 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
644 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
645 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
646 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
647 * @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
|
648 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
649 * 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
|
650 * 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
|
651 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
652 * @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
|
653 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
654 * @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
|
655 * @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
|
656 * @param bodySize The size of the body. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
657 * @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
|
658 **/ |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
659 ORTHANC_PLUGIN_INLINE int OrthancPluginRestApiPut( |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
660 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
661 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
662 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
663 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
664 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
665 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
666 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
667 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
668 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
669 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
670 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
671 return context->InvokeService(context, _OrthancPluginService_RestApiPut, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
672 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
673 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
674 |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
675 typedef struct |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
676 { |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
677 OrthancPluginRestOutput* output; |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
678 const char* redirection; |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
679 } _OrthancPluginRedirect; |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
680 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
681 /** |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
682 * @brief Redirect a GET request. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
683 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
684 * 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
|
685 * to another URI using HTTP status 301. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
686 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
687 * @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
|
688 * @param output The HTTP connection to the client application. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
689 * @param redirection Where to redirect. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
690 **/ |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
691 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect( |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
692 OrthancPluginContext* context, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
693 OrthancPluginRestOutput* output, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
694 const char* redirection) |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
695 { |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
696 _OrthancPluginRedirect params; |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
697 params.output = output; |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
698 params.redirection = redirection; |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
699 context->InvokeService(context, _OrthancPluginService_Redirect, ¶ms); |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
700 } |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
701 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
702 |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
703 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
704 typedef struct |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
705 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
706 char** result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
707 const char* identifier; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
708 } _OrthancPluginLookupResource; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
709 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
710 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
711 * @brief Look for a patient. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
712 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
713 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
714 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
715 * @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
|
716 * @param patientID The Patient ID of interest. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
717 * @return The NULL string if the patient is non-existent, or a string containing the |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
718 * 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
|
719 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
720 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
721 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
722 const char* patientID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
723 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
724 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
725 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
726 _OrthancPluginLookupResource params; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
727 params.result = &result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
728 params.identifier = patientID; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
729 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
730 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
731 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
732 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
733 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
734 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
735 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
736 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
737 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
738 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
739 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
740 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
741 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
742 * @brief Look for a study. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
743 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
744 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
745 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
746 * @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
|
747 * @param studyUID The Study Instance UID of interest. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
748 * @return The NULL string if the study is non-existent, or a string containing the |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
749 * 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
|
750 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
751 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
752 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
753 const char* studyUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
754 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
755 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
756 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
757 _OrthancPluginLookupResource params; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
758 params.result = &result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
759 params.identifier = studyUID; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
760 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
761 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
762 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
763 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
764 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
765 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
766 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
767 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
768 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
769 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
770 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
771 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
772 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
773 * @brief Look for a series. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
774 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
775 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
776 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
777 * @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
|
778 * @param seriesUID The Series Instance UID of interest. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
779 * @return The NULL string if the series is non-existent, or a string containing the |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
780 * 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
|
781 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
782 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
783 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
784 const char* seriesUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
785 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
786 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
787 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
788 _OrthancPluginLookupResource params; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
789 params.result = &result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
790 params.identifier = seriesUID; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
791 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
792 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
793 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
794 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
795 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
796 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
797 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
798 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
799 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
800 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
801 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
802 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
803 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
804 * @brief Look for an instance. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
805 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
806 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018). |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
807 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
808 * @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
|
809 * @param sopInstanceUID The SOP Instance UID of interest. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
810 * @return The NULL string if the instance is non-existent, or a string containing the |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
811 * 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
|
812 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
813 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
814 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
815 const char* sopInstanceUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
816 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
817 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
818 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
819 _OrthancPluginLookupResource params; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
820 params.result = &result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
821 params.identifier = sopInstanceUID; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
822 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
823 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, ¶ms)) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
824 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
825 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
826 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
827 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
828 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
829 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
830 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
831 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
832 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
833 |
886 | 834 #ifdef __cplusplus |
835 } | |
836 #endif | |
900 | 837 |
838 | |
839 /** @} */ | |
840 |